DCL 3.7.6
Loading...
Searching...
No Matches
Config.h
Go to the documentation of this file.
1#ifndef __DCL_CONFIG_H__
2#define __DCL_CONFIG_H__ 20110105
3
4/*****************************************************
5 OPERATING SYSTEM CONFIG
6*****************************************************/
7
8#if defined(_WIN32) || defined(_WIN64)
9 #ifndef _WIN32_WINNT
10 #define _WIN32_WINNT 0x0600
11 #endif
12 #undef __WINNT__
13 #define __WINNT__ 1
14 #if defined(__GNUC__) && !defined(__clang__)
15 #define __WINNT_GCC__ 1
16 #endif
17 #define __DCL_PTHREAD 0
18 #define __DCL_OPENSSL 0
19 #define __DCL_SCHANNEL 1
20#else
21 /* _AIX _AIX32 ..72 */
22 /* __APPLE__ __MACH__ */
23 /* __linux__ linux */
24 /* __sun__ __sun__ */
25 /* __unix__ unix */
26 #define __DCL_PTHREAD 1
27 #define __DCL_OPENSSL 1
28 #define __DCL_SCHANNEL 0
29#endif
30
31#if defined(_DEBUG) || defined(__DCL_DEBUG)
32 #undef __DCL_DEBUG
33 #define __DCL_DEBUG 1
34#endif
35
36/*****************************************************
37 COMPILE CONFIG
38*****************************************************/
39
40/*
41 * MSC로 Static Library 에서 최적화 하면 LibMain::__LibInitializer 코드가 생성되지 않는다
42 * 2011-04-26
43 */
44#define __DCL_HAVE_MANUAL_INITIALIZE 1
45
46#ifdef __DCL_DEBUG
47 #define __DCL_HAVE_THIS_FILE__ 1
48 #define __DCL_HAVE_ALLOC_DEBUG 1 /* core/Object.h */
49#endif
50
51#define __DCL_HAVE_NAMESPACE 1
52#define __DCL_HAVE_THROWS_SPEC 0
53
54#ifdef __DCL_DEBUG
55 /*
56 * 디버그 버전에서 AssertError*가 throw 될 수 있다.
57 * GCC에서 예외의 type이 cast되어 catch되지 못한다.
58 */
59 #undef __DCL_HAVE_THROWS_SPEC
60 #define __DCL_HAVE_THROWS_SPEC 0
61#endif
62
63#ifdef __WINNT__
64 #ifdef _DLL
65 #ifdef __DCL_CORE_EXPORTS
66 #define DCLCAPI __declspec(dllexport)
67 #define DCLCVAR __declspec(dllexport)
68 #define __DCL_NET_EXPORTS
69 #else
70 #define DCLCAPI __declspec(dllimport)
71 #define DCLCVAR __declspec(dllimport)
72
73 #ifdef _MSC_VER
74 #if defined(_DEBUG)
75 #pragma comment(lib, "DCLCoreDd.lib")
76 #elif defined(__DCL_DEBUG)
77 #pragma comment(lib, "DCLCoreD.lib")
78 #else
79 #pragma comment(lib, "DCLCore.lib")
80 #endif
81 #endif
82 #endif
83 #else
84 #define DCLCAPI
85 #define DCLCVAR
86 #endif
87
88 #define DCL_DSO_EXPORT __declspec(dllexport)
89#else
90 #ifdef __DCL_CORE_EXPORTS
91 #define DCLCAPI __attribute__ ((visibility("default")))
92 #define DCLCVAR __attribute__ ((visibility("default")))
93 #define __DCL_NET_EXPORTS
94 #else
95 #define DCLCAPI
96 #define DCLCVAR
97 #endif
98
99 #define DCL_DSO_EXPORT __attribute__ ((visibility("default")))
100#endif
101
102#ifdef __cplusplus
103 /*****************************************************
104 NAMESPACE CONFIG
105 *****************************************************/
106 #if __DCL_HAVE_NAMESPACE
107 #ifdef __DCL_DEBUG
108 namespace DCLd {}
109 #define __DCL_NAMESPACE_STRING L"DCLd::"
110 #define __DCL_NAMESPACE DCLd::
111 #define __DCL_USING_NAMESPACE using namespace DCLd;
112 #define __DCL_BEGIN_NAMESPACE namespace DCLd {
113 #define __DCL_END_NAMESPACE }
114 #else
115 namespace DCL { } /* dummy declaration */
116 #define __DCL_NAMESPACE_STRING L"DCL::"
117 #define __DCL_NAMESPACE DCL::
118 #define __DCL_USING_NAMESPACE using namespace DCL;
119 #define __DCL_BEGIN_NAMESPACE namespace DCL {
120 #define __DCL_END_NAMESPACE }
121 #endif
122 #else
123 #define __DCL_NAMESPACE_STRING
124 #define __DCL_NAMESPACE
125 #define __DCL_USING_NAMESPACE
126 #define __DCL_BEGIN_NAMESPACE
127 #define __DCL_END_NAMESPACE
128 #endif
129
130 /*****************************************************
131 EXCEPTION SPECIFICATION CONFIG
132 *****************************************************/
133 #if __DCL_HAVE_THROWS_SPEC
134
135 #define __DCL_THROWS0 throw()
136 #define __DCL_THROWS1(e) throw(e)
137 #define __DCL_THROWS2(e1, e2) throw(e1, e2)
138 #define __DCL_THROWS3(e1, e2, e3) throw(e1, e2, e3)
139
140 /* MSVC C++ Exception Specification ignored */
141 #ifdef _MSC_VER
142 #pragma warning(disable:4290)
143 #endif
144 #else /* __DCL_HAVE_THROWS_SPEC */
145 #define __DCL_THROWS
146 #define __DCL_THROWS1(e)
147 #define __DCL_THROWS2(e1, e2)
148 #define __DCL_THROWS3(e1, e2, e3)
149 #endif
150#else /* __cplusplus */
151 #define __DCL_THROWS
152 #define __DCL_THROWS1(e)
153 #define __DCL_THROWS2(e1, e2)
154 #define __DCL_THROWS3(e1, e2, e3)
155#endif /* __cplusplus */
156
157/*****************************************************
158 BASIC TYPE DEFINITION
159*****************************************************/
160
161#define __NEED_mbstate_t
162/* need size_t, ssize_t */
163#include <stddef.h>
164#include <sys/types.h>
165
166#if defined(__DEFINED_ssize_t) || defined(_SSIZE_T_DEFINED) \
167 || defined(_SSIZE_T_DEFINED_) || defined(_SSIZE_T)
168 /* Alpine musl bits/alltypes.h __DEFINED_ssize_t */
169 /* MinGW _SSIZE_T_DEFINED */
170 /* Bionic __ANDROID__ _SSIZE_T_DEFINED_ */
171 /* _AIX __APPLE__ _SSIZE_T */
172 #define __ssize_t_defined
173#endif
174
175#ifndef __ssize_t_defined
176 #ifdef __GNUC__
177 typedef __ssize_t ssize_t;
178 #elif defined(_WIN64)
179 typedef __int64 ssize_t;
180 #elif defined(_WIN32)
181 typedef __int32 ssize_t;
182 #endif
183 #define __ssize_t_defined
184#endif
185
186#ifdef __GNUC__
187 typedef int errno_t;
188 #define __errno_t_defined
189#endif
190#ifdef _MSC_VER
191 #if _MSC_VER <= 1200
192 typedef int errno_t;
193 #endif
194 #define __errno_t_defined
195#endif
196
197#if defined(__WINNT__) && !defined(PATH_MAX)
198 /* _MSC_VER 에서 _POSIX_가 !defined 이면 PATH_MAX가 포함되지 않는다. */
199 #ifdef _MAX_PATH
200 #define PATH_MAX _MAX_PATH
201 #elif defined(MAX_PATH)
202 #define PATH_MAX MAX_PATH
203 #else
204 #define PATH_MAX 1024
205 #endif
206#endif
207
208#include <stdint.h>
209
210#ifndef __WORDSIZE
211 /* linux stdint.h/bits/wordsize.h */
212 /* macOS stdint.h */
213 /* _MSC_VER _WIN64 _WIN32 */
214 /* _AIX __PPC64__ _AIX32 */
215 /* __GNUC__ _LP64 __LP64__ */
216 #if defined(_WIN64) || defined(_LP64)
217 #define __WORDSIZE 64
218 #elif defined(_WIN32) || defined(_AIX32)
219 #define __WORDSIZE 32
220 #else
221 #error "Unknown marchine wordsize!"
222 #endif
223#endif
224
225#ifndef __BYTE_ORDER__
226 /* _MSC_VER */
227 #define __ORDER_LITTLE_ENDIAN__ 1234
228 #define __ORDER_BIG_ENDIAN__ 4321
229 #define __ORDER_PDP_ENDIAN__ 3412
230 #if defined(_M_IX86) || defined(_M_X64) \
231 || defined(_M_ARM) || defined(_M_ARM64)
232 #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
233 #endif
234 #ifdef _M_IA64
235 #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
236 #endif
237#endif
238
239#ifndef __SIZEOF_WCHAR_T__
240 /* _MSC_VER */
241 #if WCHAR_MAX == 0xffff
242 // wchar_t == unsigned short
243 // wint_t == unsigned int
244 #define __SIZEOF_WCHAR_T__ 2
245 #else
246 #define __SIZEOF_WCHAR_T__ 4
247 #endif
248#endif
249
250typedef unsigned char byte_t;
251typedef wchar_t char_t;
252
253/* limits */
254#undef INT8_MIN
255#undef INT16_MIN
256#undef INT32_MIN
257#undef INT64_MIN
258
259#undef INT8_MAX
260#undef INT16_MAX
261#undef INT32_MAX
262#undef INT64_MAX
263
264#undef UINT8_MAX
265#undef UINT16_MAX
266#undef UINT32_MAX
267#undef UINT64_MAX
268
269#include <limits.h>
270
271#ifdef _MSC_VER
272 #define INT8_MIN _I8_MIN
273 #define INT16_MIN _I16_MIN
274 #define INT32_MIN _I32_MIN
275 #define INT64_MIN _I64_MIN
276
277 #define INT8_MAX _I8_MAX
278 #define INT16_MAX _I16_MAX
279 #define INT32_MAX _I32_MAX
280 #define INT64_MAX _I64_MAX
281
282 #define UINT8_MAX _UI8_MAX
283 #define UINT16_MAX _UI16_MAX
284 #define UINT32_MAX _UI32_MAX
285 #define UINT64_MAX _UI64_MAX
286#else /* __GNUC__ */
287 #define INT8_MIN SCHAR_MIN
288 #define INT16_MIN SHRT_MIN
289 #define INT32_MIN INT_MIN
290 #define INT64_MIN LLONG_MIN
291
292 #define INT8_MAX SCHAR_MAX
293 #define INT16_MAX SHRT_MAX
294 #define INT32_MAX INT_MAX
295 #define INT64_MAX LLONG_MAX
296
297 #define UINT8_MAX UCHAR_MAX
298 #define UINT16_MAX USHRT_MAX
299 #define UINT32_MAX UINT_MAX
300 #define UINT64_MAX ULLONG_MAX
301#endif
302
303#ifdef __GNUC__
304 #undef BOOL
305 #undef TRUE
306 #undef FALSE
307 typedef int BOOL;
308 #define FALSE 0
309 #define TRUE !FALSE
310#endif
311
312#ifndef NULL
313 #ifdef __cplusplus
314 #define NULL 0
315 #else
316 #define NULL (void*)0
317 #endif
318#endif
319
320/*****************************************************
321 COMMENTS DEFINATIONS
322*****************************************************/
323
324#undef _CONST
325#undef _PRIVATE
326#undef _PROTECTED
327#undef _PUBLIC
328
329#define _CONST
330#define _PRIVATE public
331#define _PROTECTED public
332#define _PUBLIC
333
334/* close() 에서 참조된 객체를 close하지 않는다 */
335#define __noclose__
336
337/* close() 에서 포인터로 넘겨받은 객체를 close하고 destroy 한다 */
338#define __destroy__
339
340#define __countof(array, type) (sizeof(array) / sizeof(type))
341
342#ifdef _MSC_VER
343#define __UNUSED__
344#else
345#define __UNUSED__ __attribute__((unused))
346#endif
347
348/*****************************************************
349 DCL VERSION INFORMATION
350*****************************************************/
351
352#include "Version.h"
353
354/* uModuleType */
355#define DCL_CORE_LIB 1
356#define DCL_NET_LIB 2
357#define DCL_SQL_DRIVER_MODULE 11
358#define DCL_HTTP_SERVLET_MODULE 21
359
360#define DCL_DSO_ENTRY_POINT DCLDSOEntryPoint
361#define DCL_DSO_ENTRY_POINT_STRING "DCLDSOEntryPoint"
362
363#ifdef __DCL_DEBUG
364 #define DCL_BUILD_FLAG 1
365#else
366 #define DCL_BUILD_FLAG 0
367#endif
368
369/*
370 DCL DSO Module Entry Example
371
372typedef struct
373{
374 // DCL common members
375 uint32_t uSize; // size of this structure
376 uint32_t uDCLVersion; // DCL_VERSION
377 uint32_t uBuldFlag; // release(0), debug(1)
378 uint32_t uModuleType; //
379 const wchar_t* pszDescription; // module description
380
381 // application private members
382 uint32_t uVersion; // module application version
383 ...
384} MODULE_SPEC
385
386extern "C" {
387DCL_DSO_EXPORT
388MODULE_SPEC DCL_DSO_ENTRY_POINT =
389{
390 sizeof(MODULE_SPEC),
391 DCL_VERSION,
392 DCL_BUILD_FLAG,
393 DCL_SQL_DRIVER_MODULE, // if module is database driver
394 L"simple description",
395 DCL_SQL_VERSION,
396 ...
397};
398}
399
400*/
401
402typedef struct __DCL_LIBRARY_MODULE
403{
404 uint32_t uSize; /* size of this structure */
405 uint32_t uDCLVersion; /* DCL_VERSION */
406 const char* pszBuildTimeStamp; /* __BUILD_TIMESTAMP__ */
407 uint32_t uBuldFlag; /* release(0), debug(1) */
408 uint32_t uModuleType; /* DCL_CORE_LIB, ... */
409 const char* pszDescription; /* module description */
410
412
413#define DCL_WIN_REG_BASE L"Software\\Daejung Kim\\DCL"
414
415#endif /* __DCL_CONFIG_H__ */
#define __int64
Definition __xtoa.cpp:15
#define __int32
Definition __xtoa.cpp:11
wchar_t char_t
Definition Config.h:251
unsigned char byte_t
Definition Config.h:250
struct __DCL_LIBRARY_MODULE DCL_LIBRARY_MODULE
int BOOL
const char * pszDescription
Definition Config.h:409
uint32_t uDCLVersion
Definition Config.h:405
const char * pszBuildTimeStamp
Definition Config.h:406
uint32_t uModuleType
Definition Config.h:408
uint32_t uBuldFlag
Definition Config.h:407