annotate src/compiler.h @ 1744:e4f996d69637

[xemacs-hg @ 2003-10-14 14:40:08 by james] Fix compiler.h induced warnings and update depend.
author james
date Tue, 14 Oct 2003 14:40:27 +0000
parents 543769b89fed
children 19b0fcab3f47
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
1 /* Compiler-specific definitions for XEmacs.
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
2 Copyright (C) 1998-1999, 2003 Free Software Foundation, Inc.
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
3 Copyright (C) 1994 Richard Mlynarik.
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
4
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
5 This file is part of XEmacs.
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
6
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
7 XEmacs is free software; you can redistribute it and/or modify it
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
10 later version.
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
11
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
15 for more details.
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
16
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
18 along with XEmacs; see the file COPYING. If not, write to
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
20 Boston, MA 02111-1307, USA. */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
21
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
22 /* Synched up with: not in FSF. */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
23
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
24 /* Authorship:
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
25
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
26 NOT_REACHED, DOESNT_RETURN, PRINTF_ARGS by Richard Mlynarik, c. 1994.
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
27 RETURN_SANS_WARNING by Martin buchholz, 1998 or 1999.
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
28 Many changes and improvements by Jerry James, 2003.
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
29 Split out of lisp.h, reorganized, and modernized.
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
30 {BEGIN,END}_C_DECLS, NEED_GCC, GCC_VERSION
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
31 ATTRIBUTE_MALLOC, ATTRIBUTE_CONST, ATTRIBUTE_PURE, UNUSED_ARG
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
32 */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
33
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
34 #ifndef INCLUDED_compiler_h
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
35 #define INCLUDED_compiler_h
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
36
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
37 /* Define min() and max(). (Some compilers put them in strange places that
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
38 won't be referenced by include files used by XEmacs, such as 'macros.h'
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
39 under Solaris.) */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
40
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
41 #ifndef min
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
42 #define min(a,b) (((a) <= (b)) ? (a) : (b))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
43 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
44 #ifndef max
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
45 #define max(a,b) (((a) > (b)) ? (a) : (b))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
46 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
47
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
48 /* Regular C complains about possible clobbering of local vars NOT declared
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
49 as volatile if there's a longjmp() in a function. C++ complains if such
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
50 vars ARE volatile; or more correctly, sans volatile no problem even when
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
51 you longjmp, avec volatile you get unfixable compile errors like
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
52
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
53 /src/xemacs/lilfix/src/process-unix.c: In function `void
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
54 unix_send_process(Lisp_Object, lstream*)':
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
55 /src/xemacs/lilfix/src/process-unix.c:1577: no matching function for call to `
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
56 Lisp_Object::Lisp_Object(volatile Lisp_Object&)'
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
57 /src/xemacs/lilfix/src/lisp-union.h:32: candidates are:
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
58 Lisp_Object::Lisp_Object(const Lisp_Object&)
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
59 */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
60
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
61 #ifdef __cplusplus
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
62 #define VOLATILE_IF_NOT_CPP
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
63 #else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
64 #define VOLATILE_IF_NOT_CPP volatile
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
65 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
66
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
67 /* Avoid indentation problems when XEmacs sees the curly braces */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
68 #ifndef BEGIN_C_DECLS
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
69 # ifdef __cplusplus
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
70 # define BEGIN_C_DECLS extern "C" {
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
71 # define END_C_DECLS }
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
72 # else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
73 # define BEGIN_C_DECLS
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
74 # define END_C_DECLS
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
75 # endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
76 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
77
1744
e4f996d69637 [xemacs-hg @ 2003-10-14 14:40:08 by james]
james
parents: 1743
diff changeset
78 /* Macro simplification for non-GNU compilers and older gccs that did not
e4f996d69637 [xemacs-hg @ 2003-10-14 14:40:08 by james]
james
parents: 1743
diff changeset
79 define all of these symbols */
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
80 #ifndef __GNUC__
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
81 #define __GNUC__ 0
1744
e4f996d69637 [xemacs-hg @ 2003-10-14 14:40:08 by james]
james
parents: 1743
diff changeset
82 #endif
e4f996d69637 [xemacs-hg @ 2003-10-14 14:40:08 by james]
james
parents: 1743
diff changeset
83 #ifndef __GNUC_MINOR__
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
84 #define __GNUC_MINOR__ 0
1744
e4f996d69637 [xemacs-hg @ 2003-10-14 14:40:08 by james]
james
parents: 1743
diff changeset
85 #endif
e4f996d69637 [xemacs-hg @ 2003-10-14 14:40:08 by james]
james
parents: 1743
diff changeset
86 #ifndef __GNUC_PATCHLEVEL__
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
87 #define __GNUC_PATCHLEVEL__ 0
1744
e4f996d69637 [xemacs-hg @ 2003-10-14 14:40:08 by james]
james
parents: 1743
diff changeset
88 #endif
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
89
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
90 /* Simplify testing for specific GCC versions. This also works for non-GCC
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
91 compilers, where GCC_VERSION is zero. */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
92 #ifndef NEED_GCC
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
93 #define NEED_GCC(major,minor,patch) (major * 1000000 + minor * 1000 + patch)
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
94 #endif /* NEED_GCC */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
95 #ifndef GCC_VERSION
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
96 #define GCC_VERSION NEED_GCC (__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
97 #endif /* GCC_VERSION */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
98
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
99 /* GCC < 2.6.0 could only declare one attribute per function. In that case,
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
100 we define DOESNT_RETURN in preference to PRINTF_ARGS, which is only used
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
101 for checking args against the string spec. */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
102 #ifndef PRINTF_ARGS
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
103 # if (GCC_VERSION >= NEED_GCC (2, 6, 0))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
104 # define PRINTF_ARGS(string_index,first_to_check) \
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
105 __attribute__ ((format (printf, string_index, first_to_check)))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
106 # else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
107 # define PRINTF_ARGS(string_index,first_to_check)
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
108 # endif /* GNUC */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
109 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
110
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
111 #ifndef DOESNT_RETURN
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
112 # if (GCC_VERSION > NEED_GCC (0, 0, 0))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
113 # if (GCC_VERSION >= NEED_GCC (2, 5, 0))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
114 # if (GCC_VERSION < NEED_GCC (3, 0, 0))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
115 /* GCC 3.2 -O3 issues complaints in Fcommand_loop_1 about no return
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
116 statement if we have this definition */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
117 # define RETURN_NOT_REACHED(value) DO_NOTHING
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
118 # endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
119 # define DOESNT_RETURN void
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
120 # define DECLARE_DOESNT_RETURN(decl) void decl __attribute__ ((noreturn))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
121 # else /* GCC_VERSION < NEED_GCC (2, 5, 0) */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
122 # define DOESNT_RETURN void volatile
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
123 # define DECLARE_DOESNT_RETURN(decl) void volatile decl
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
124 # endif /* GCC_VERSION >= NEED_GCC (2, 5, 0) */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
125 # else /* not gcc */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
126 # define DOESNT_RETURN void
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
127 # define DECLARE_DOESNT_RETURN(decl) void decl
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
128 # endif /* GCC_VERSION > NEED_GCC (0, 0, 0) */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
129 #endif /* DOESNT_RETURN */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
130
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
131 /* Another try to fix SunPro C compiler warnings */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
132 /* "end-of-loop code not reached" */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
133 /* "statement not reached */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
134 #if defined __SUNPRO_C || defined __USLC__
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
135 #define RETURN_SANS_WARNINGS if (1) return
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
136 #define RETURN_NOT_REACHED(value) DO_NOTHING
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
137 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
138
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
139 /* More ways to shut up compiler. This works in Fcommand_loop_1(),
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
140 where there's an infinite loop in a function returning a Lisp object.
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
141 */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
142 #if defined (_MSC_VER) || defined (__SUNPRO_C) || defined (__SUNPRO_CC) || \
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
143 (defined (DEC_ALPHA) && defined (OSF1))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
144 #define DO_NOTHING_DISABLING_NO_RETURN_WARNINGS if (0) return Qnil
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
145 #else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
146 #define DO_NOTHING_DISABLING_NO_RETURN_WARNINGS DO_NOTHING
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
147 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
148
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
149 #ifndef RETURN_NOT_REACHED
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
150 #define RETURN_NOT_REACHED(value) return (value)
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
151 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
152
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
153 #ifndef RETURN_SANS_WARNINGS
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
154 #define RETURN_SANS_WARNINGS return
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
155 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
156
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
157 #ifndef DO_NOTHING
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
158 #define DO_NOTHING do {} while (0)
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
159 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
160
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
161 #ifndef DECLARE_NOTHING
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
162 #define DECLARE_NOTHING struct nosuchstruct
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
163 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
164
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
165 #ifndef ATTRIBUTE_MALLOC
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
166 # if (GCC_VERSION >= NEED_GCC (2, 96, 0))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
167 # define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
168 # else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
169 # define ATTRIBUTE_MALLOC
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
170 # endif /* GCC_VERSION >= NEED_GCC (2, 96, 0) */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
171 #endif /* ATTRIBUTE_MALLOC */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
172
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
173 #ifndef ATTRIBUTE_PURE
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
174 # if (GCC_VERSION >= NEED_GCC (2, 96, 0))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
175 # define ATTRIBUTE_PURE __attribute__ ((pure))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
176 # else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
177 # define ATTRIBUTE_PURE
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
178 # endif /* GCC_VERSION >= NEED_GCC (2, 96, 0) */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
179 #endif /* ATTRIBUTE_PURE */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
180
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
181 #ifndef ATTRIBUTE_CONST
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
182 # if (GCC_VERSION >= NEED_GCC (2, 5, 0))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
183 # define ATTRIBUTE_CONST __attribute__ ((const))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
184 # define CONST_FUNC
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
185 # else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
186 # define ATTRIBUTE_CONST
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
187 # define CONST_FUNC const
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
188 # endif /* GCC_VERSION >= NEED_GCC (2, 5, 0) */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
189 #endif /* ATTRIBUTE_CONST */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
190
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
191 /* Unused declarations; g++ doesn't support this. */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
192 #ifndef UNUSED_ARG
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
193 # if defined(__GNUC__) && !defined(__cplusplus)
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
194 # define UNUSED_ARG __attribute__ ((unused))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
195 # else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
196 # define UNUSED_ARG
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
197 # endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
198 #endif /* ATTRIBUTE_UNUSED */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
199
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
200 #ifdef DEBUG_XEMACS
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
201 #define REGISTER
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
202 #define register
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
203 #else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
204 #define REGISTER register
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
205 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
206
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
207 #if defined(HAVE_MS_WINDOWS) && defined(HAVE_SHLIB)
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
208 # ifdef EMACS_MODULE
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
209 # define MODULE_API __declspec(dllimport)
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
210 # else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
211 # define MODULE_API __declspec(dllexport)
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
212 # endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
213 #else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
214 # define MODULE_API
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
215 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
216
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
217 #endif /* INCLUDED_compiler_h */