Merge from mainline.
[official-gcc.git] / libjava / classpath / native / target / generic / target_generic.h
blobc2264330d28f18718990f4b12a9fa896dce9172f
1 /* generic_math_int64.h - Native methods for 64bit math operations
2 Copyright (C) 1998 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
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.
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.
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.
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.
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. */
39 Description: generic target global defintions
40 Systems : all
43 #ifndef __TARGET_GENERIC__
44 #define __TARGET_GENERIC__
46 /* check if target_native_network.h included */
47 #ifndef __TARGET_NATIVE__
48 #error Do NOT INCLUDE generic target files! Include the corresponding native target files instead!
49 #endif
51 /****************************** Includes *******************************/
52 /* do not move; needed here because of some macro definitions */
53 #include "config.h"
55 #include <stdlib.h>
56 #include <errno.h>
58 /****************** Conditional compilation switches *******************/
60 /***************************** Constants *******************************/
61 #define TARGET_NATIVE_OK 1
62 #define TARGET_NATIVE_ERROR 0
64 #ifndef TARGET_NATIVE_ERROR_PERMISION_DENIED
65 #define TARGET_NATIVE_ERROR_PERMISION_DENIED EACCES
66 #endif
67 #ifndef TARGET_NATIVE_ERROR_BAD_FILE_DESCRIPTOR
68 #define TARGET_NATIVE_ERROR_BAD_FILE_DESCRIPTOR EBADF
69 #endif
70 #ifndef TARGET_NATIVE_ERROR_FILE_EXISTS
71 #define TARGET_NATIVE_ERROR_FILE_EXISTS EEXIST
72 #endif
73 #ifndef TARGET_NATIVE_ERROR_INPUT_OUTPUT
74 #define TARGET_NATIVE_ERROR_INPUT_OUTPUT EIO
75 #endif
76 #ifndef TARGET_NATIVE_ERROR_TOO_MANY_OPEN_FILES
77 #define TARGET_NATIVE_ERROR_TOO_MANY_OPEN_FILES EMFILE
78 #endif
79 #ifndef TARGET_NATIVE_ERROR_FILENAME_TO_LONG
80 #define TARGET_NATIVE_ERROR_FILENAME_TO_LONG ENAMETOOLONG
81 #endif
82 #ifndef TARGET_NATIVE_ERROR_NO_SUCH_DEVICE
83 #define TARGET_NATIVE_ERROR_NO_SUCH_DEVICE ENODEV
84 #endif
85 #ifndef TARGET_NATIVE_ERROR_NO_SUCH_FILE
86 #define TARGET_NATIVE_ERROR_NO_SUCH_FILE ENOENT
87 #endif
88 #ifndef TARGET_NATIVE_ERROR_NO_SPACE_LEFT
89 #define TARGET_NATIVE_ERROR_NO_SPACE_LEFT ENOSPC
90 #endif
91 #ifndef TARGET_NATIVE_ERROR_DIRECTORY_NOT_EMPTY
92 #define TARGET_NATIVE_ERROR_DIRECTORY_NOT_EMPTY ENOTEMPTY
93 #endif
94 #ifndef TARGET_NATIVE_ERROR_OPERATION_NOT_PERMITTED
95 #define TARGET_NATIVE_ERROR_OPERATION_NOT_PERMITTED EPERM
96 #endif
97 #ifndef TARGET_NATIVE_ERROR_READ_ONLY_FILE_SYSTEM
98 #define TARGET_NATIVE_ERROR_READ_ONLY_FILE_SYSTEM EROFS
99 #endif
100 #ifndef TARGET_NATIVE_ERROR_INVALID_SEEK
101 #define TARGET_NATIVE_ERROR_INVALID_SEEK ESPIPE
102 #endif
103 #ifndef TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL
104 #define TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL EINTR
105 #endif
107 /***************************** Datatypes *******************************/
109 /***************************** Variables *******************************/
111 /****************************** Macros *********************************/
113 /***********************************************************************\
114 * Name : TARGET_NATIVE_LAST_ERROR
115 * Purpose : return last error code
116 * Input : -
117 * Output : -
118 * Return : error code
119 * Side-effect: unknown
120 * Notes : -
121 \***********************************************************************/
123 #ifndef TARGET_NATIVE_LAST_ERROR
124 #include <errno.h>
125 #define TARGET_NATIVE_LAST_ERROR() \
126 errno
127 #endif
129 /***********************************************************************\
130 * Name : TARGET_NATIVE_LAST_ERROR_STRING
131 * Purpose : return last error string
132 * Input : -
133 * Output : -
134 * Return : error string (read only!)
135 * Side-effect: unknown
136 * Notes : -
137 \***********************************************************************/
139 #ifndef TARGET_NATIVE_LAST_ERROR_STRING
140 #include <string.h>
141 #include <errno.h>
142 #define TARGET_NATIVE_LAST_ERROR_STRING() \
143 strerror(errno)
144 #endif
146 #ifndef TARGET_NATIVE_LAST_ERROR_STRING_FORMAT
147 #include <string.h>
148 #include <errno.h>
149 #define TARGET_NATIVE_LAST_ERROR_STRING_FORMAT(buffer,bufferSize,format) \
150 do { \
151 sprintf(buffer, "%s", format); \
152 strcat(" (error: "); \
153 strcat(strerror(errno)); \
154 strcat(")"); \
155 } while (0)
156 #endif
158 /***************************** Functions *******************************/
160 #ifdef __cplusplus
161 extern "C" {
162 #endif
164 #ifdef __cplusplus
166 #endif
168 #endif /* __TARGET_GENERIC__ */
170 /* end of file */