globals.c revision 485f0483
1/* $Xorg: globals.c,v 1.4 2001/02/09 02:03:50 xorgcvs Exp $ */ 2/* 3 4Copyright 1989, 1998 The Open Group 5 6Permission to use, copy, modify, distribute, and sell this software and its 7documentation for any purpose is hereby granted without fee, provided that 8the above copyright notice appear in all copies and that both that 9copyright notice and this permission notice appear in supporting 10documentation. 11 12The above copyright notice and this permission notice shall be included 13in all copies or substantial portions of the Software. 14 15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 16OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 19OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 21OTHER DEALINGS IN THE SOFTWARE. 22 23Except as contained in this notice, the name of The Open Group shall 24not be used in advertising or otherwise to promote the sale, use or 25other dealings in this Software without prior written authorization 26from The Open Group. 27 28*/ 29/* $XFree86: xc/lib/Xext/globals.c,v 3.4 2001/07/29 05:01:12 tsi Exp $ */ 30 31/* 32 * This file should contain only those objects which must be predefined. 33 */ 34#ifdef HAVE_CONFIG_H 35#include <config.h> 36#endif 37#include <X11/Xlib.h> 38#include <X11/extensions/Xext.h> 39#include <stddef.h> /* for definition of NULL */ 40 41/* 42 * If possible, it is useful to have the global data default to a null value. 43 * Some shared library implementations are *much* happier if there isn't any 44 * global initialized data. 45 */ 46#ifdef NULL_NOT_ZERO /* then need to initialize */ 47#define SetZero(t,var,z) t var = z 48#else 49#define SetZero(t,var,z) t var 50#endif 51 52#ifdef ATTSHAREDLIB /* then need extra variables */ 53/* 54 * If we need to define extra variables for each global 55 */ 56#if !defined(UNIXCPP) || defined(ANSICPP) 57#define ZEROINIT(t,var,val) SetZero(t,var,val); \ 58 SetZero (long, _libX_##var##Flag, 0); \ 59 SetZero (void *, _libX_##var##Ptr, NULL) 60#else /* else pcc concatenation */ 61#define ZEROINIT(t,var,val) SetZero(t,var,val); \ 62 SetZero (long, _libX_/**/var/**/Flag, 0); \ 63 SetZero (void *, _libX_/**/var/**/Ptr, NULL) 64#endif /* concat ANSI C vs. pcc */ 65 66#else /* else not ATTSHAREDLIB */ 67/* 68 * no extra crud 69 */ 70#define ZEROINIT(t,var,val) SetZero (t, var, val) 71 72#endif /* ATTSHAREDLIB */ 73 74 75/* 76 * Error handlers; used to be in XlibInt.c 77 */ 78ZEROINIT (XextErrorHandler, _XExtensionErrorFunction, NULL); 79 80/* 81 * NOTE: any additional external definition NEED 82 * to be inserted BELOW this point!!! 83 */ 84 85/* 86 * NOTE: any additional external definition NEED 87 * to be inserted ABOVE this point!!! 88 */ 89 90