DCL 3.7.4
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/* need size_t, ssize_t */
162#include <stddef.h>
163#include <sys/types.h>
164
165#if defined(_SSIZE_T_DEFINED) || defined(_SSIZE_T)
166 /* _AIX __APPLE__ _SSIZE_T */
167 /* MinGW _SSIZE_T_DEFINED */
168 #define __ssize_t_defined
169#endif
170
171#ifndef __ssize_t_defined
172 #ifdef __GNUC__
173 typedef __ssize_t ssize_t;
174 #elif defined(_WIN64)
175 typedef __int64 ssize_t;
176 #elif defined(_WIN32)
177 typedef __int32 ssize_t;
178 #endif
179 #define __ssize_t_defined
180#endif
181
182#ifdef __GNUC__
183 typedef int errno_t;
184 #define __errno_t_defined
185#endif
186#ifdef _MSC_VER
187 #if _MSC_VER <= 1200
188 typedef int errno_t;
189 #endif
190 #define __errno_t_defined
191#endif
192
193#if defined(__WINNT__) && !defined(PATH_MAX)
194 /* _MSC_VER 에서 _POSIX_가 !defined 이면 PATH_MAX가 포함되지 않는다. */
195 #ifdef _MAX_PATH
196 #define PATH_MAX _MAX_PATH
197 #elif defined(MAX_PATH)
198 #define PATH_MAX MAX_PATH
199 #else
200 #define PATH_MAX 1024
201 #endif
202#endif
203
204#include <stdint.h>
205
206#ifndef __WORDSIZE
207 /* linux stdint.h/bits/wordsize.h */
208 /* macOS stdint.h */
209 /* _MSC_VER _WIN64 _WIN32 */
210 /* _AIX __PPC64__ _AIX32 */
211 /* __GNUC__ _LP64 __LP64__ */
212 #if defined(_WIN64) || defined(_LP64)
213 #define __WORDSIZE 64
214 #elif defined(_WIN32) || defined(_AIX32)
215 #define __WORDSIZE 32
216 #else
217 #error "Unknown marchine wordsize!"
218 #endif
219#endif
220
221#ifndef __BYTE_ORDER__
222 /* _MSC_VER */
223 #define __ORDER_LITTLE_ENDIAN__ 1234
224 #define __ORDER_BIG_ENDIAN__ 4321
225 #define __ORDER_PDP_ENDIAN__ 3412
226 #if defined(_M_IX86) || defined(_M_X64) \
227 || defined(_M_ARM) || defined(_M_ARM64)
228 #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
229 #endif
230 #ifdef _M_IA64
231 #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
232 #endif
233#endif
234
235#ifndef __SIZEOF_WCHAR_T__
236 /* _MSC_VER */
237 #if WCHAR_MAX == 0xffff
238 // wchar_t == unsigned short
239 // wint_t == unsigned int
240 #define __SIZEOF_WCHAR_T__ 2
241 #else
242 #define __SIZEOF_WCHAR_T__ 4
243 #endif
244#endif
245
246typedef unsigned char byte_t;
247typedef wchar_t char_t;
248
249/* limits */
250#undef INT8_MIN
251#undef INT16_MIN
252#undef INT32_MIN
253#undef INT64_MIN
254
255#undef INT8_MAX
256#undef INT16_MAX
257#undef INT32_MAX
258#undef INT64_MAX
259
260#undef UINT8_MAX
261#undef UINT16_MAX
262#undef UINT32_MAX
263#undef UINT64_MAX
264
265#include <limits.h>
266
267#ifdef _MSC_VER
268 #define INT8_MIN _I8_MIN
269 #define INT16_MIN _I16_MIN
270 #define INT32_MIN _I32_MIN
271 #define INT64_MIN _I64_MIN
272
273 #define INT8_MAX _I8_MAX
274 #define INT16_MAX _I16_MAX
275 #define INT32_MAX _I32_MAX
276 #define INT64_MAX _I64_MAX
277
278 #define UINT8_MAX _UI8_MAX
279 #define UINT16_MAX _UI16_MAX
280 #define UINT32_MAX _UI32_MAX
281 #define UINT64_MAX _UI64_MAX
282#else /* __GNUC__ */
283 #define INT8_MIN SCHAR_MIN
284 #define INT16_MIN SHRT_MIN
285 #define INT32_MIN INT_MIN
286 #define INT64_MIN LLONG_MIN
287
288 #define INT8_MAX SCHAR_MAX
289 #define INT16_MAX SHRT_MAX
290 #define INT32_MAX INT_MAX
291 #define INT64_MAX LLONG_MAX
292
293 #define UINT8_MAX UCHAR_MAX
294 #define UINT16_MAX USHRT_MAX
295 #define UINT32_MAX UINT_MAX
296 #define UINT64_MAX ULLONG_MAX
297#endif
298
299#ifdef __GNUC__
300 #undef BOOL
301 #undef TRUE
302 #undef FALSE
303 typedef int BOOL;
304 #define FALSE 0
305 #define TRUE !FALSE
306#endif
307
308#ifndef NULL
309 #ifdef __cplusplus
310 #define NULL 0
311 #else
312 #define NULL (void*)0
313 #endif
314#endif
315
316/*****************************************************
317 COMMENTS DEFINATIONS
318*****************************************************/
319
320#undef _CONST
321#undef _PRIVATE
322#undef _PROTECTED
323#undef _PUBLIC
324
325#define _CONST
326#define _PRIVATE public
327#define _PROTECTED public
328#define _PUBLIC
329
330/* close() 에서 참조된 객체를 close하지 않는다 */
331#define __noclose__
332
333/* close() 에서 포인터로 넘겨받은 객체를 close하고 destroy 한다 */
334#define __destroy__
335
336#define __countof(array, type) (sizeof(array) / sizeof(type))
337
338#ifdef _MSC_VER
339#define __UNUSED__
340#else
341#define __UNUSED__ __attribute__((unused))
342#endif
343
344/*****************************************************
345 DCL VERSION INFORMATION
346*****************************************************/
347
348#include "Version.h"
349
350/* uModuleType */
351#define DCL_CORE_LIB 1
352#define DCL_NET_LIB 2
353#define DCL_SQL_DRIVER_MODULE 11
354#define DCL_HTTP_SERVLET_MODULE 21
355
356#define DCL_DSO_ENTRY_POINT DCLDSOEntryPoint
357#define DCL_DSO_ENTRY_POINT_STRING "DCLDSOEntryPoint"
358
359#ifdef __DCL_DEBUG
360 #define DCL_BUILD_FLAG 1
361#else
362 #define DCL_BUILD_FLAG 0
363#endif
364
365/*
366 DCL DSO Module Entry Example
367
368typedef struct
369{
370 // DCL common members
371 uint32_t uSize; // size of this structure
372 uint32_t uDCLVersion; // DCL_VERSION
373 uint32_t uBuldFlag; // release(0), debug(1)
374 uint32_t uModuleType; //
375 const wchar_t* pszDescription; // module description
376
377 // application private members
378 uint32_t uVersion; // module application version
379 ...
380} MODULE_SPEC
381
382extern "C" {
383DCL_DSO_EXPORT
384MODULE_SPEC DCL_DSO_ENTRY_POINT =
385{
386 sizeof(MODULE_SPEC),
387 DCL_VERSION,
388 DCL_BUILD_FLAG,
389 DCL_SQL_DRIVER_MODULE, // if module is database driver
390 L"simple description",
391 DCL_SQL_VERSION,
392 ...
393};
394}
395
396*/
397
398typedef struct __DCL_LIBRARY_MODULE
399{
400 uint32_t uSize; /* size of this structure */
401 uint32_t uDCLVersion; /* DCL_VERSION */
402 const char* pszBuildTimeStamp; /* __BUILD_TIMESTAMP__ */
403 uint32_t uBuldFlag; /* release(0), debug(1) */
404 uint32_t uModuleType; /* DCL_CORE_LIB, ... */
405 const char* pszDescription; /* module description */
406
408
409#define DCL_WIN_REG_BASE L"Software\\Daejung Kim\\DCL"
410
411#endif /* __DCL_CONFIG_H__ */
#define __int64
Definition __xtoa.cpp:15
#define __int32
Definition __xtoa.cpp:11
wchar_t char_t
Definition Config.h:247
unsigned char byte_t
Definition Config.h:246
struct __DCL_LIBRARY_MODULE DCL_LIBRARY_MODULE
int BOOL
const char * pszDescription
Definition Config.h:405
uint32_t uDCLVersion
Definition Config.h:401
const char * pszBuildTimeStamp
Definition Config.h:402
uint32_t uModuleType
Definition Config.h:404
uint32_t uBuldFlag
Definition Config.h:403