OSDN Git Service

* config/i386/i386.md (*sinxf2): Rename to *sinxf2_i387.
[pf3gnuchains/gcc-fork.git] / libjava / classpath / native / target / generic / target_generic_misc.h
1 /* generic_math_int64.h - Native methods for 64bit math operations
2    Copyright (C) 1998 Free Software Foundation, Inc.
3
4 This file is part of GNU Classpath.
5
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10  
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING.  If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
20
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library.  Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
25
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module.  An independent module is a module which is not derived from
33 or based on this library.  If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so.  If you do not wish to do so, delete this
36 exception statement from your version. */
37
38 /*
39 Description: generic target defintions of miscellaneous functions
40 Systems    : all
41 */
42
43 #ifndef __TARGET_GENERIC_MISC__
44 #define __TARGET_GENERIC_MISC__
45
46 /* check if target_native_misc.h included */
47 #ifndef __TARGET_NATIVE_MISC__
48   #error Do NOT INCLUDE generic target files! Include the corresponding native target files instead!
49 #endif
50
51 /****************************** Includes *******************************/
52 /* do not move; needed here because of some macro definitions */
53 #include "config.h"
54
55 #include <stdlib.h>
56 #include <assert.h>
57
58 #include "target_native.h"
59
60 /****************** Conditional compilation switches *******************/
61
62 /***************************** Constants *******************************/
63
64 /***************************** Datatypes *******************************/
65
66 /***************************** Variables *******************************/
67
68 /****************************** Macros *********************************/
69
70 /***********************************************************************\
71 * Name       : TARGET_NATIVE_MISC_FORMAT_STRING<n>
72 * Purpose    : format a string (with a fixed number of) arguments
73 * Input      : buffer     - buffer for string
74 *              bufferSize - size of buffer
75 *              format     - format string (like printf)
76 *              args       - optional arguments (GNU CPP only!)
77 * Output     : -
78 * Return     : -
79 * Side-effect: unknown
80 * Notes      : - this is a "safe" macro to format string; buffer-
81 *                overflows will be avoided. Direct usage of e. g.
82 *                snprintf() is not permitted because it is not ANSI C
83 *                (not portable!)
84 *              - do not use this routine in a function without
85 *                variable number of arguments (ellipses), because
86 *                va_list/va_start/va_end is used!
87 \***********************************************************************/
88
89 #ifndef TARGET_NATIVE_MISC_FORMAT_STRING0
90   #include <stdarg.h>
91   #define TARGET_NATIVE_MISC_FORMAT_STRING0(buffer,bufferSize,format) \
92     do { \
93       snprintf(buffer,bufferSize, "%s", format); \
94     } while (0)
95 #endif
96 #ifndef TARGET_NATIVE_MISC_FORMAT_STRING1
97   #include <stdarg.h>
98   #define TARGET_NATIVE_MISC_FORMAT_STRING1(buffer,bufferSize,format,arg1) \
99     do { \
100       snprintf(buffer,bufferSize,format,arg1); \
101     } while (0)
102 #endif
103 #ifndef TARGET_NATIVE_MISC_FORMAT_STRING2
104   #include <stdarg.h>
105   #define TARGET_NATIVE_MISC_FORMAT_STRING2(buffer,bufferSize,format,arg1,arg2) \
106     do { \
107       snprintf(buffer,bufferSize,format,arg1,arg2); \
108     } while (0)
109 #endif
110 #ifndef TARGET_NATIVE_MISC_FORMAT_STRING3
111   #include <stdarg.h>
112   #define TARGET_NATIVE_MISC_FORMAT_STRING3(buffer,bufferSize,format,arg1,arg2,arg3) \
113     do { \
114       snprintf(buffer,bufferSize,format,arg1,arg2,arg3); \
115     } while (0)
116 #endif
117 #ifndef TARGET_NATIVE_MISC_FORMAT_STRING4
118   #include <stdarg.h>
119   #define TARGET_NATIVE_MISC_FORMAT_STRING4(buffer,bufferSize,format,arg1,arg2,arg3,arg4) \
120     do { \
121       snprintf(buffer,bufferSize,format,arg1,arg2,arg3,arg4); \
122     } while (0)
123 #endif
124 #ifndef TARGET_NATIVE_MISC_FORMAT_STRING5
125   #include <stdarg.h>
126   #define TARGET_NATIVE_MISC_FORMAT_STRING5(buffer,bufferSize,format,arg1,arg2,arg3,arg4,arg5) \
127     do { \
128       snprintf(buffer,bufferSize,format,arg1,arg2,arg3,arg4,arg5); \
129     } while (0)
130 #endif
131 #ifndef TARGET_NATIVE_MISC_FORMAT_STRING6
132   #include <stdarg.h>
133   #define TARGET_NATIVE_MISC_FORMAT_STRING6(buffer,bufferSize,format,arg1,arg2,arg3,arg4,arg5,arg6) \
134     do { \
135       snprintf(buffer,bufferSize,format,arg1,arg2,arg3,arg4,arg5,arg6); \
136     } while (0)
137 #endif
138 #ifndef TARGET_NATIVE_MISC_FORMAT_STRING7
139   #include <stdarg.h>
140   #define TARGET_NATIVE_MISC_FORMAT_STRING7(buffer,bufferSize,format,arg1,arg2,arg3,arg14,arg5,arg6,arg7) \
141     do { \
142       snprintf(buffer,bufferSize,format,arg1,arg2,arg3,arg4,arg5,arg6,arg7); \
143     } while (0)
144 #endif
145 #ifndef TARGET_NATIVE_MISC_FORMAT_STRING8
146   #include <stdarg.h>
147   #define TARGET_NATIVE_MISC_FORMAT_STRING8(buffer,bufferSize,format,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) \
148     do { \
149       snprintf(buffer,bufferSize,format,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); \
150     } while (0)
151 #endif
152 #ifndef TARGET_NATIVE_MISC_FORMAT_STRING9
153   #include <stdarg.h>
154   #define TARGET_NATIVE_MISC_FORMAT_STRING9(buffer,bufferSize,format,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) \
155     do { \
156       snprintf(buffer,bufferSize,format,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); \
157     } while (0)
158 #endif
159
160 /***********************************************************************\
161 * Name       : TARGET_NATIVE_FORMAT_STRING_ELLIPSE
162 * Purpose    : format a string with arguments
163 * Input      : buffer     - buffer for string
164 *              bufferSize - size of buffer
165 *              format     - format string (like printf)
166 * Output     : -
167 * Return     : -
168 * Side-effect: unknown
169 * Notes      : - this is a "safe" macro to format string; buffer-
170 *                overflows will be avoided. Direct usage of e. g.
171 *                snprintf() is not permitted because it is not ANSI C
172 *                (not portable!)
173 *              - do not use this routine in a function without
174 *                variable number of arguments (ellipses), because
175 *                va_list/va_start/va_end is used!
176 \***********************************************************************/
177
178 #ifndef TARGET_NATIVE_MISC_FORMAT_STRING_ELLIPSE
179   #include <stdarg.h>
180   #define TARGET_NATIVE_FORMAT_STRING_ELLIPSE(buffer,bufferSize,format) \
181     do { \
182       va_list __arguments; \
183       \
184       va_start(__arguments,format); \
185       vsnprintf(buffer,bufferSize,format,__arguments); \
186       va_end(__arguments); \
187     } while (0)
188 #endif
189
190 /***************************** Functions *******************************/
191
192 #ifdef __cplusplus
193 extern "C" {
194 #endif
195
196 #ifdef __cplusplus
197 }
198 #endif
199
200 #endif /* __TARGET_GENERIC_MISC__ */
201
202 /* end of file */
203