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