annotate src/compiler.h @ 2286:04bc9d2f42c7

[xemacs-hg @ 2004-09-20 19:18:55 by james] Mark all unused parameters as unused. Also eliminate some unneeded local variables.
author james
date Mon, 20 Sep 2004 19:20:08 +0000
parents 0be6ff2356c8
children ba4677f54a05
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
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2270
diff changeset
31 ATTRIBUTE_MALLOC, ATTRIBUTE_CONST, ATTRIBUTE_PURE, UNUSED
1743
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
2268
61855263cb07 [xemacs-hg @ 2004-09-14 14:32:29 by james]
james
parents: 1748
diff changeset
113 #ifndef DOESNT_RETURN_TYPE
1743
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))
2270
0be6ff2356c8 [xemacs-hg @ 2004-09-14 18:22:31 by james]
james
parents: 2268
diff changeset
116 # ifndef __INTEL_COMPILER
0be6ff2356c8 [xemacs-hg @ 2004-09-14 18:22:31 by james]
james
parents: 2268
diff changeset
117 # define RETURN_NOT_REACHED(value) DO_NOTHING
0be6ff2356c8 [xemacs-hg @ 2004-09-14 18:22:31 by james]
james
parents: 2268
diff changeset
118 # endif
2268
61855263cb07 [xemacs-hg @ 2004-09-14 14:32:29 by james]
james
parents: 1748
diff changeset
119 # define DOESNT_RETURN_TYPE(rettype) rettype
61855263cb07 [xemacs-hg @ 2004-09-14 14:32:29 by james]
james
parents: 1748
diff changeset
120 # define DECLARE_DOESNT_RETURN_TYPE(rettype,decl) rettype decl \
61855263cb07 [xemacs-hg @ 2004-09-14 14:32:29 by james]
james
parents: 1748
diff changeset
121 __attribute__ ((noreturn))
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
122 # else /* GCC_VERSION < NEED_GCC (2, 5, 0) */
2268
61855263cb07 [xemacs-hg @ 2004-09-14 14:32:29 by james]
james
parents: 1748
diff changeset
123 # define DOESNT_RETURN_TYPE(rettype) rettype volatile
61855263cb07 [xemacs-hg @ 2004-09-14 14:32:29 by james]
james
parents: 1748
diff changeset
124 # define DECLARE_DOESNT_RETURN_TYPE(rettype,decl) rettype volatile decl
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
125 # endif /* GCC_VERSION >= NEED_GCC (2, 5, 0) */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
126 # else /* not gcc */
2268
61855263cb07 [xemacs-hg @ 2004-09-14 14:32:29 by james]
james
parents: 1748
diff changeset
127 # define DOESNT_RETURN_TYPE(rettype) rettype
61855263cb07 [xemacs-hg @ 2004-09-14 14:32:29 by james]
james
parents: 1748
diff changeset
128 # define DECLARE_DOESNT_RETURN_TYPE(rettype,decl) rettype decl
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
129 # endif /* GCC_VERSION > NEED_GCC (0, 0, 0) */
2268
61855263cb07 [xemacs-hg @ 2004-09-14 14:32:29 by james]
james
parents: 1748
diff changeset
130 #endif /* DOESNT_RETURN_TYPE */
61855263cb07 [xemacs-hg @ 2004-09-14 14:32:29 by james]
james
parents: 1748
diff changeset
131 #ifndef DOESNT_RETURN
61855263cb07 [xemacs-hg @ 2004-09-14 14:32:29 by james]
james
parents: 1748
diff changeset
132 # define DOESNT_RETURN DOESNT_RETURN_TYPE (void)
61855263cb07 [xemacs-hg @ 2004-09-14 14:32:29 by james]
james
parents: 1748
diff changeset
133 # define DECLARE_DOESNT_RETURN(decl) DECLARE_DOESNT_RETURN_TYPE (void, decl)
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
134 #endif /* DOESNT_RETURN */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
135
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
136 /* Another try to fix SunPro C compiler warnings */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
137 /* "end-of-loop code not reached" */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
138 /* "statement not reached */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
139 #if defined __SUNPRO_C || defined __USLC__
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
140 # define RETURN_SANS_WARNINGS if (1) return
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
141 # define RETURN_NOT_REACHED(value) DO_NOTHING
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
142 #endif
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 /* 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
145 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
146 */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
147 #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
148 (defined (DEC_ALPHA) && defined (OSF1))
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
149 # 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
150 #else
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
151 # 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
152 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
153
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
154 #ifndef RETURN_NOT_REACHED
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
155 # define RETURN_NOT_REACHED(value) return (value)
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
156 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
157
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
158 #ifndef RETURN_SANS_WARNINGS
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
159 # define RETURN_SANS_WARNINGS return
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
160 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
161
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
162 #ifndef DO_NOTHING
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
163 # define DO_NOTHING do {} while (0)
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
164 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
165
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
166 #ifndef DECLARE_NOTHING
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
167 # define DECLARE_NOTHING struct nosuchstruct
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
168 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
169
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
170 #ifndef ATTRIBUTE_MALLOC
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
171 # if (GCC_VERSION >= NEED_GCC (2, 96, 0))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
172 # define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
173 # else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
174 # define ATTRIBUTE_MALLOC
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
175 # endif /* GCC_VERSION >= NEED_GCC (2, 96, 0) */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
176 #endif /* ATTRIBUTE_MALLOC */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
177
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
178 #ifndef ATTRIBUTE_PURE
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
179 # if (GCC_VERSION >= NEED_GCC (2, 96, 0))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
180 # define ATTRIBUTE_PURE __attribute__ ((pure))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
181 # else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
182 # define ATTRIBUTE_PURE
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
183 # endif /* GCC_VERSION >= NEED_GCC (2, 96, 0) */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
184 #endif /* ATTRIBUTE_PURE */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
185
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
186 #ifndef ATTRIBUTE_CONST
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
187 # if (GCC_VERSION >= NEED_GCC (2, 5, 0))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
188 # define ATTRIBUTE_CONST __attribute__ ((const))
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
189 # define CONST_FUNC
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
190 # else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
191 # define ATTRIBUTE_CONST
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
192 # define CONST_FUNC const
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
193 # endif /* GCC_VERSION >= NEED_GCC (2, 5, 0) */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
194 #endif /* ATTRIBUTE_CONST */
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
195
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2270
diff changeset
196 /* Unused declarations; g++ and icc do not support this. */
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
197 #ifndef UNUSED_ARG
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2270
diff changeset
198 # define UNUSED_ARG(decl) unused_##decl
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2270
diff changeset
199 #endif
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2270
diff changeset
200 #ifndef UNUSED
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2270
diff changeset
201 # if defined(__GNUC__) && !defined(__cplusplus) && !defined(__INTEL_COMPILER)
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2270
diff changeset
202 # define ATTRIBUTE_UNUSED __attribute__ ((unused))
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
203 # else
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2270
diff changeset
204 # define ATTRIBUTE_UNUSED
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
205 # endif
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2270
diff changeset
206 # define UNUSED(decl) UNUSED_ARG (decl) ATTRIBUTE_UNUSED
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2270
diff changeset
207 #endif /* UNUSED */
1743
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 #ifdef DEBUG_XEMACS
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
210 # define REGISTER
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
211 # define register
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
212 #else
1748
19b0fcab3f47 [xemacs-hg @ 2003-10-14 17:01:09 by james]
james
parents: 1744
diff changeset
213 # define REGISTER register
1743
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
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
216 #if defined(HAVE_MS_WINDOWS) && defined(HAVE_SHLIB)
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
217 # ifdef EMACS_MODULE
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
218 # define MODULE_API __declspec(dllimport)
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
219 # else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
220 # define MODULE_API __declspec(dllexport)
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
221 # endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
222 #else
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
223 # define MODULE_API
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
224 #endif
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
225
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents:
diff changeset
226 #endif /* INCLUDED_compiler_h */