# axutil_utils_defines.h

    00001
    00002 /*
    00003  * Licensed to the Apache Software Foundation (ASF) under one or more
    00004  * contributor license agreements.  See the NOTICE file distributed with
    00005  * this work for additional information regarding copyright ownership.
    00006  * The ASF licenses this file to You under the Apache License, Version 2.0
    00007  * (the "License"); you may not use this file except in compliance with
    00008  * the License.  You may obtain a copy of the License at
    00009  *
    00010  *      http://www.apache.org/licenses/LICENSE-2.0
    00011  *
    00012  * Unless required by applicable law or agreed to in writing, software
    00013  * distributed under the License is distributed on an "AS IS" BASIS,
    00014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00015  * See the License for the specific language governing permissions and
    00016  * limitations under the License.
    00017  */
    00018
    00019 #ifndef AXUTIL_UTILS_DEFINES_H
    00020 #define AXUTIL_UTILS_DEFINES_H
    00021
    00022 #include <stddef.h>
    00023
    00024 #if !defined(WIN32)
    00025 #include <stdint.h>
    00026 #endif
    00027
    00028 #ifdef __cplusplus
    00029 extern "C"
    00030 {
    00031 #endif
    00032
    00033 #if defined(WIN32) && !defined(AXIS2_SKIP_INT_TYPEDEFS)
    00034
    00037     typedef unsigned __int8 uint8_t;
    00038     typedef __int8 int8_t;
    00039     typedef unsigned __int16 uint16_t;
    00040     typedef __int16 int16_t;
    00041     typedef unsigned __int32 uint32_t;
    00042     typedef __int32 int32_t;
    00043     typedef unsigned __int64 uint64_t;
    00044     typedef __int64 int64_t;
    00045 #endif
    00046
    00052 #if defined(WIN32)
    00053 #define AXIS2_PRINTF_INT64_FORMAT_SPECIFIER "%I64d"
    00054 #define AXIS2_PRINTF_UINT64_FORMAT_SPECIFIER "%I64u"
    00055 #define AXIS2_PRINTF_INT32_FORMAT_SPECIFIER "%I32d"
    00056 #define AXIS2_PRINTF_UINT32_FORMAT_SPECIFIER "%I32u"
    00057 #else
    00058 #if __WORDSIZE == 64
    00059 #define AXIS2_PRINTF_INT64_FORMAT_SPECIFIER "%ld"
    00060 #define AXIS2_PRINTF_UINT64_FORMAT_SPECIFIER "%lu"
    00061 #else
    00062 #define AXIS2_PRINTF_INT64_FORMAT_SPECIFIER "%lld"
    00063 #define AXIS2_PRINTF_UINT64_FORMAT_SPECIFIER "%llu"
    00064 #endif
    00065 #define AXIS2_PRINTF_INT32_FORMAT_SPECIFIER "%d"
    00066 #define AXIS2_PRINTF_UINT32_FORMAT_SPECIFIER "%u"
    00067 #endif
    00068
    00072     typedef char axis2_char_t;
    00073     typedef int axis2_bool_t;
    00074     typedef int axis2_status_t;
    00075     typedef int axis2_scope_t;
    00076     typedef unsigned int axis2_ssize_t;
    00077     typedef char axis2_byte_t;
    00078         typedef unsigned char axis2_unsigned_byte_t;
    00079
    00080 #define AXIS2_STRING(s) s
    00081
    00082 #define AXIS2_CHAR(c) c
    00083
    00084 #define AXIS2_CRLF_LENGTH 2
    00085
    00086 #define AXIS2_CRLF "\r\n"
    00087
    00088     /* These constant definitions should later be moved to platform dependant
    00089      * files
    00090      */
    00091
    00092 #define AXIS2_EOLN '\0'
    00093
    00097 #define AXIS2_TRUE 1
    00098 #define AXIS2_FALSE 0
    00099
    00103 #if defined(WIN32) && !defined(AXIS2_DECLARE_STATIC)
    00104 #define AXIS2_EXPORT __declspec(dllexport)
    00105 #else
    00106 #define AXIS2_EXPORT
    00107 #endif
    00108
    00112 #if defined(WIN32)
    00113 #define AXIS2_IMPORT __declspec(dllimport)
    00114 #else
    00115 #define AXIS2_IMPORT
    00116 #endif
    00117
    00121 #if defined(__GNUC__)
    00122 #if defined(__i386)
    00123 #define AXIS2_CALL __attribute__((cdecl))
    00124 #define AXIS2_WUR __attribute__((warn_unused_result))
    00125 #else
    00126 #define AXIS2_CALL
    00127 #define AXIS2_WUR
    00128
    00129
    00130 #endif
    00131 #else
    00132 #if defined(__unix)
    00133 #define AXIS2_CALL
    00134 #define AXIS2_WUR
    00135
    00136
    00137 #else                           /* WIN32 */
    00138 #define AXIS2_CALL __stdcall
    00139 #define AXIS2_WUR
    00140 #endif
    00141 #endif
    00142 #define AXIS2_THREAD_FUNC AXIS2_CALL
    00143
    00144
    00145 #ifdef DOXYGEN
    00146
    00147     /* define these just so doxygen documents them */
    00148
    00160 # define AXIS2_DECLARE_STATIC
    00161
    00168 # define AXIS2_DECLARE_EXPORT
    00169
    00170 #endif                          /* def DOXYGEN */
    00171
    00172 #if !defined(WIN32)
    00173
    00186 #define AXIS2_EXTERN
    00187
    00196 #define AXIS2_DECLARE_NONSTD(type)     type
    00197
    00206 #define AXIS2_DECLARE_DATA
    00207
    00208 #elif defined(AXIS2_DECLARE_STATIC)
    00209 #define AXIS2_EXTERN
    00210 #define AXIS2_EXTERN_NONSTD
    00211 #define AXIS2_DECLARE_DATA
    00212 #elif defined(AXIS2_DECLARE_EXPORT)
    00213 #define AXIS2_EXTERN                    AXIS2_EXPORT
    00214 #define AXIS2_EXTERN_NONSTD             AXIS2_EXPORT
    00215 #define AXIS2_DECLARE_DATA
    00216 #else
    00217 #define AXIS2_EXTERN                    AXIS2_IMPORT
    00218 #define AXIS2_EXTERN_NONSTD             AXIS2_IMPORT
    00219 #define AXIS2_DECLARE_DATA
    00220 #endif
    00221
    00222 #ifdef __cplusplus
    00223 }
    00224 #endif
    00225
    00226 #endif                          /* AXIS2_UTILS_DEFINES_H */