1 /* $Xorg: globals.c,v 1.4 2001/02/09 02:03:50 xorgcvs Exp $ */
4 Copyright 1989, 1998 The Open Group
6 Permission to use, copy, modify, distribute, and sell this software and its
7 documentation for any purpose is hereby granted without fee, provided that
8 the above copyright notice appear in all copies and that both that
9 copyright notice and this permission notice appear in supporting
12 The above copyright notice and this permission notice shall be included
13 in all copies or substantial portions of the Software.
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 OTHER DEALINGS IN THE SOFTWARE.
23 Except as contained in this notice, the name of The Open Group shall
24 not be used in advertising or otherwise to promote the sale, use or
25 other dealings in this Software without prior written authorization
29 /* $XFree86: xc/lib/Xext/globals.c,v 3.4 2001/07/29 05:01:12 tsi Exp $ */
32 * This file should contain only those objects which must be predefined.
38 #include <X11/extensions/Xext.h>
39 #include <stddef.h> /* for definition of NULL */
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.
46 #ifdef NULL_NOT_ZERO /* then need to initialize */
47 #define SetZero(t,var,z) t var = z
49 #define SetZero(t,var,z) t var
52 #ifdef ATTSHAREDLIB /* then need extra variables */
54 * If we need to define extra variables for each global
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 */
66 #else /* else not ATTSHAREDLIB */
70 #define ZEROINIT(t,var,val) SetZero (t, var, val)
72 #endif /* ATTSHAREDLIB */
76 * Error handlers; used to be in XlibInt.c
78 typedef int (*funcptr
)();
79 ZEROINIT (funcptr
, _XExtensionErrorFunction
, NULL
);
82 * NOTE: any additional external definition NEED
83 * to be inserted BELOW this point!!!
87 * NOTE: any additional external definition NEED
88 * to be inserted ABOVE this point!!!