upscaledb  2.1.13
types.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2016 Christoph Rupp (chris@crupp.de).
3  * All Rights Reserved.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * See the file COPYING for License information.
16  */
17 
18 
26 #ifndef UPS_TYPES_H
27 #define UPS_TYPES_H
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 /*
34  * Check the operating system and word size
35  */
36 #ifdef WIN32
37 # undef UPS_OS_WIN32
38 # define UPS_OS_WIN32 1
39 # ifdef WIN64
40 # undef UPS_64BIT
41 # define UPS_64BIT 1
42 # elif WIN32
43 # undef UPS_32BIT
44 # define UPS_32BIT 1
45 # else
46 # error "Neither WIN32 nor WIN64 defined!"
47 # endif
48 #else /* posix? */
49 # undef UPS_OS_POSIX
50 # define UPS_OS_POSIX 1
51 # if defined(__LP64__) || defined(__LP64) || __WORDSIZE == 64
52 # undef UPS_64BIT
53 # define UPS_64BIT 1
54 # else
55 # undef UPS_32BIT
56 # define UPS_32BIT 1
57 # endif
58 #endif
59 
60 #if defined(UPS_OS_POSIX) && defined(UPS_OS_WIN32)
61 # error "Unknown arch - neither UPS_OS_POSIX nor UPS_OS_WIN32 defined"
62 #endif
63 
64 /*
65  * improve memory debugging on WIN32 by using crtdbg.h (only MSVC
66  * compiler and debug builds!)
67  *
68  * make sure crtdbg.h is loaded before malloc.h!
69  */
70 #if defined(_MSC_VER) && defined(UPS_OS_WIN32)
71 # if (defined(WIN32) || defined(__WIN32)) && !defined(UNDER_CE)
72 # if defined(DEBUG) || defined(_DEBUG)
73 # ifndef _CRTDBG_MAP_ALLOC
74 # define _CRTDBG_MAP_ALLOC 1
75 # endif
76 # endif
77 # include <crtdbg.h>
78 # include <malloc.h>
79 # endif
80 #endif
81 
82 /*
83  * Create the EXPORT macro for Microsoft Visual C++
84  */
85 #ifndef UPS_EXPORT
86 # ifdef _MSC_VER
87 # define UPS_EXPORT __declspec(dllexport)
88 # else
89 # define UPS_EXPORT extern
90 # endif
91 #endif
92 
93 /*
94  * The default calling convention is cdecl
95  */
96 #ifndef UPS_CALLCONV
97 # define UPS_CALLCONV
98 #endif
99 
100 /*
101  * Common typedefs. Since stdint.h is not available on older versions of
102  * Microsoft Visual Studio, they get declared here.
103  * http://msinttypes.googlecode.com/svn/trunk/stdint.h
104  */
105 #if _MSC_VER
106 # include <ups/msstdint.h>
107 #else
108 # include <stdint.h>
109 #endif
110 
111 /* Deprecated typedefs; used prior to 2.1.10. Please do not use them! */
118 typedef int8_t ups_s8_t;
120 
121 /*
122  * Undefine macros to avoid macro redefinitions
123  */
124 #undef UPS_INVALID_FD
125 #undef UPS_FALSE
126 #undef UPS_TRUE
127 
131 typedef int ups_bool_t;
132 #define UPS_FALSE 0
133 #define UPS_TRUE (!UPS_FALSE)
134 
138 typedef int ups_status_t;
139 
140 
141 #ifdef __cplusplus
142 } // extern "C"
143 #endif
144 
145 #endif /* UPS_TYPES_H */
int16_t ups_s16_t
Definition: types.h:116
int ups_bool_t
Definition: types.h:131
unsigned short uint16_t
Definition: msstdint.h:84
unsigned __int64 uint64_t
Definition: msstdint.h:95
unsigned char uint8_t
Definition: msstdint.h:83
int32_t ups_s32_t
Definition: types.h:114
signed char int8_t
Definition: msstdint.h:80
unsigned int uint32_t
Definition: msstdint.h:85
uint16_t ups_u16_t
Definition: types.h:117
int64_t ups_s64_t
Definition: types.h:112
int8_t ups_s8_t
Definition: types.h:118
signed short int16_t
Definition: msstdint.h:81
uint8_t ups_u8_t
Definition: types.h:119
signed __int64 int64_t
Definition: msstdint.h:94
int ups_status_t
Definition: types.h:138
signed int int32_t
Definition: msstdint.h:82
uint64_t ups_u64_t
Definition: types.h:113
uint32_t ups_u32_t
Definition: types.h:115