annotate src/compiler.h @ 2073:65dae79be48b

[xemacs-hg @ 2004-05-12 06:16:14 by stephent] improve tag tests <87isf2xjcw.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Wed, 12 May 2004 06:16:20 +0000
parents 19b0fcab3f47
children 61855263cb07
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
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
42 # define min(a,b) (((a) <= (b)) ? (a) : (b))
1743
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
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
45 # define max(a,b) (((a) > (b)) ? (a) : (b))
1743
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
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
62 # define VOLATILE_IF_NOT_CPP
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
63 #else
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
64 # define VOLATILE_IF_NOT_CPP volatile
1743
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
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
78 /* Guard against older gccs that did not define all of these symbols */
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
79 #ifdef __GNUC__
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
80 # ifndef __GNUC_MINOR__
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
81 # define __GNUC_MINOR__ 0
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
82 # endif
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
83 # ifndef __GNUC_PATCHLEVEL__
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
84 # define __GNUC_PATCHLEVEL__ 0
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
85 # endif
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
86 #endif /* __GNUC__ */
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
87
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
88 /* Simplify testing for specific GCC versions. For non-GNU compilers,
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
89 GCC_VERSION evaluates to zero. */
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
90 #ifndef NEED_GCC
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
91 # define NEED_GCC(major,minor,patch) (major * 1000000 + minor * 1000 + patch)
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
92 #endif /* NEED_GCC */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
93 #ifndef GCC_VERSION
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
94 # ifdef __GNUC__
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
95 # define GCC_VERSION NEED_GCC (__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
96 # else
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
97 # define GCC_VERSION 0
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
98 # endif /* __GNUC__ */
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
99 #endif /* GCC_VERSION */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
100
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
101 /* 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
102 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
103 for checking args against the string spec. */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
104 #ifndef PRINTF_ARGS
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
105 # if (GCC_VERSION >= NEED_GCC (2, 6, 0))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
106 # define PRINTF_ARGS(string_index,first_to_check) \
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
107 __attribute__ ((format (printf, string_index, first_to_check)))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
108 # else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
109 # define PRINTF_ARGS(string_index,first_to_check)
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
110 # endif /* GNUC */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
111 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
112
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
113 #ifndef DOESNT_RETURN
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
114 # if (GCC_VERSION > NEED_GCC (0, 0, 0))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
115 # if (GCC_VERSION >= NEED_GCC (2, 5, 0))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
116 # if (GCC_VERSION < NEED_GCC (3, 0, 0))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
117 /* 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
118 statement if we have this definition */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
119 # define RETURN_NOT_REACHED(value) DO_NOTHING
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
120 # endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
121 # define DOESNT_RETURN void
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
122 # define DECLARE_DOESNT_RETURN(decl) void decl __attribute__ ((noreturn))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
123 # else /* GCC_VERSION < NEED_GCC (2, 5, 0) */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
124 # define DOESNT_RETURN void volatile
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
125 # define DECLARE_DOESNT_RETURN(decl) void volatile decl
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
126 # endif /* GCC_VERSION >= NEED_GCC (2, 5, 0) */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
127 # else /* not gcc */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
128 # define DOESNT_RETURN void
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
129 # define DECLARE_DOESNT_RETURN(decl) void decl
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
130 # endif /* GCC_VERSION > NEED_GCC (0, 0, 0) */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
131 #endif /* DOESNT_RETURN */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
132
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
133 /* Another try to fix SunPro C compiler warnings */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
134 /* "end-of-loop code not reached" */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
135 /* "statement not reached */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
136 #if defined __SUNPRO_C || defined __USLC__
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
137 # define RETURN_SANS_WARNINGS if (1) return
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
138 # define RETURN_NOT_REACHED(value) DO_NOTHING
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
139 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
140
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
141 /* 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
142 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
143 */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
144 #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
145 (defined (DEC_ALPHA) && defined (OSF1))
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
146 # define DO_NOTHING_DISABLING_NO_RETURN_WARNINGS if (0) return Qnil
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
147 #else
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
148 # define DO_NOTHING_DISABLING_NO_RETURN_WARNINGS DO_NOTHING
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
149 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
150
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
151 #ifndef RETURN_NOT_REACHED
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
152 # define RETURN_NOT_REACHED(value) return (value)
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
153 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
154
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
155 #ifndef RETURN_SANS_WARNINGS
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
156 # define RETURN_SANS_WARNINGS return
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
157 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
158
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
159 #ifndef DO_NOTHING
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
160 # define DO_NOTHING do {} while (0)
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
161 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
162
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
163 #ifndef DECLARE_NOTHING
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
164 # define DECLARE_NOTHING struct nosuchstruct
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
165 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
166
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
167 #ifndef ATTRIBUTE_MALLOC
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
168 # if (GCC_VERSION >= NEED_GCC (2, 96, 0))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
169 # define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
170 # else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
171 # define ATTRIBUTE_MALLOC
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
172 # endif /* GCC_VERSION >= NEED_GCC (2, 96, 0) */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
173 #endif /* ATTRIBUTE_MALLOC */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
174
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
175 #ifndef ATTRIBUTE_PURE
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
176 # if (GCC_VERSION >= NEED_GCC (2, 96, 0))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
177 # define ATTRIBUTE_PURE __attribute__ ((pure))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
178 # else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
179 # define ATTRIBUTE_PURE
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
180 # endif /* GCC_VERSION >= NEED_GCC (2, 96, 0) */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
181 #endif /* ATTRIBUTE_PURE */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
182
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
183 #ifndef ATTRIBUTE_CONST
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
184 # if (GCC_VERSION >= NEED_GCC (2, 5, 0))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
185 # define ATTRIBUTE_CONST __attribute__ ((const))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
186 # define CONST_FUNC
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
187 # else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
188 # define ATTRIBUTE_CONST
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
189 # define CONST_FUNC const
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
190 # endif /* GCC_VERSION >= NEED_GCC (2, 5, 0) */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
191 #endif /* ATTRIBUTE_CONST */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
192
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
193 /* Unused declarations; g++ doesn't support this. */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
194 #ifndef UNUSED_ARG
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
195 # if defined(__GNUC__) && !defined(__cplusplus)
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
196 # define UNUSED_ARG __attribute__ ((unused))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
197 # else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
198 # define UNUSED_ARG
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
199 # endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
200 #endif /* ATTRIBUTE_UNUSED */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
201
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
202 #ifdef DEBUG_XEMACS
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
203 # define REGISTER
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
204 # define register
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
205 #else
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
206 # define REGISTER register
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
207 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
208
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
209 #if defined(HAVE_MS_WINDOWS) && defined(HAVE_SHLIB)
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
210 # ifdef EMACS_MODULE
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
211 # define MODULE_API __declspec(dllimport)
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
212 # else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
213 # define MODULE_API __declspec(dllexport)
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
214 # endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
215 #else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
216 # define MODULE_API
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
217 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
218
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
219 #endif /* INCLUDED_compiler_h */