00001
00002
00003
00004
00005 #ifndef DOSETUP_H
00006 #define DOSETUP_H
00007
00012 #ifdef DO_HAVE_CUSTOM_DOSETUP
00013
00014
00015 #include "DoSetup-custom.h"
00016 #elif defined(DO_CUSTOM_SETUP_FILE)
00017
00019 #include DO_CUSTOM_SETUP_FILE
00020 #else
00021 #endif
00022
00023
00024 #include "pi/platform.h"
00025
00026
00027 #include "pi/visibility.h"
00028
00029
00030 #define DYNOBJ_MAJOR_VERSION 0
00031 #define DYNOBJ_MINOR_VERSION 80
00032
00033
00036 #if DOXYGEN_BUILD
00037
00038 #undef DO_USE_RUNTIME
00039 #undef DO_USE_DYNSHARED
00040 #undef DO_FAT_VOBJ
00041 #undef docall
00042
00044 #define DO_BUILDING_DYNOBJ
00045
00046 #define DO_MODULE
00047
00048 #undef DO_RETURN_STRUCT_WITH_DTOR_SAFE
00049
00054 #define DO_HAVE_CUSTOM_DOSETUP
00055
00057 #define DO_CUSTOM_SETUP_FILE
00058
00059 #define DO_ASSERT_MSG(v,msg)
00060 #endif
00061
00062
00063
00064 #ifdef DO_BUILDING_DYNOBJ
00065
00066
00067 #ifdef DO_MODULE
00068
00071 #ifndef DO_LIB_NAME
00072
00073 #define DO_LIB_NAME "__auto__"
00074 #ifndef MSVC_COMPATIBLE
00075 #warning Library name not set. Setting to: __auto__
00076 #else
00077 #pragma message("Library name not set. Setting to: __auto__")
00078 #endif
00079 #endif
00080 #ifndef DO_LIB_AUTHOR
00081
00082 #define DO_LIB_AUTHOR "Anonymous"
00083
00084 #ifndef MSVC_COMPATIBLE
00085 #warning Library author undefined. Defining to: "Anonymous"
00086 #else
00087 #pragma message("Library author undefined. Defining to: 'Anonymous'")
00088 #endif
00089 #endif
00090 #ifndef DO_LIB_DESCR
00091
00092 #define DO_LIB_DESCR "No description"
00093 #endif
00094 #ifndef DO_LIB_MAJOR_VERSION
00095 #ifndef MSVC_COMPATIBLE
00096 #warning Library version undefined. Defining major/minor version to: 0.50
00097 #else
00098 #pragma message("Library version undefined. Defining major/minor version to: 0.50")
00099 #endif
00100
00101 #define DO_LIB_MAJOR_VERSION 0
00102
00103 #undef DO_LIB_MINOR_VERSION
00104 #define DO_LIB_MINOR_VERSION 50
00105 #endif
00106 #else
00107
00108 #ifndef DO_LIB_NAME
00109 #define DO_LIB_NAME "Main App"
00110 #endif
00111 #ifndef DO_LIB_AUTHOR
00112 #define DO_LIB_AUTHOR "---"
00113 #endif
00114 #ifndef DO_LIB_DESCR
00115 #define DO_LIB_DESCR "This is the main app"
00116 #endif
00117 #define DO_LIB_MAJOR_VERSION 1
00118 #define DO_LIB_MINOR_VERSION 0
00119 #endif
00120 #endif
00121
00122
00127 #ifndef DO_LOG2_NR_TYPES
00128 #define DO_LOG2_NR_TYPES 5
00129 #endif
00130
00131
00138 #ifndef DO_USE_RUNTIME
00139 #define DO_USE_RUNTIME 1
00140 #endif
00141
00142
00145 #ifndef DO_THREADED
00146 #define DO_THREADED 0
00147 #endif
00148
00149 #if DO_THREADED==0
00150
00151 #undef NOTIF_THREADED
00152 #else
00153 #define NOTIF_THREADED
00154 #endif
00155
00156
00160 #ifndef DO_USE_DYNSHARED
00161 #define DO_USE_DYNSHARED 1
00162 #endif
00163
00168 #ifndef DO_USE_NOTIFIER
00169 #if DO_USE_RUNTIME==1 && defined(DO_MAIN)
00170 #define DO_USE_NOTIFIER 1
00171 #else
00172 #define DO_USE_NOTIFIER 0
00173 #endif
00174 #endif
00175
00194 #ifndef DO_ENABLE_VTABLE_CORR
00195 #define DO_ENABLE_VTABLE_CORR 0
00196 #endif
00197
00198
00202 #ifndef DO_FAT_VOBJ
00203 #define DO_FAT_VOBJ 1
00204 #endif
00205
00206
00212 #ifndef DO_NO_TYPEINFO
00213 #define DO_NO_TYPEINFO 0
00214 #endif
00215
00216
00233 #ifndef docall
00234 #ifdef __WINDOWS
00235 #define docall __cdecl
00236 #define DO_CALLSTR "__cdecl"
00237 #elif defined(__LINUX) || defined(__UNIX)
00238
00239 #define docall
00240 #define DO_CALLSTR ""
00241 #endif
00242 #endif
00243 #ifndef DO_CALLSTR
00244 #error No DO_CALLSTR defined!
00245 #endif
00246
00247
00248
00255 #ifndef DO_ENABLE_VTABLE_DISPATCH
00256 #define DO_ENABLE_VTABLE_DISPATCH 0
00257 #endif
00258
00259
00267 #ifndef DO_DENY_EARLY_UNLOAD
00268 #define DO_DENY_EARLY_UNLOAD 0
00269 #endif
00270
00277 #ifndef DI_GET_TYPE
00278 #if DO_ENABLE_VTABLE_CORR==1
00279
00280 #define DI_GET_TYPE(pdi) (pdi)->doGetType(NULL)
00281
00282 #define DI_GET_TYPE_VIRTUAL
00283 #else
00284
00285 #define DI_GET_TYPE(pdi) ::doGetType(pdi)
00286
00287 #define DI_GET_TYPE_GLOBAL
00288 #endif
00289 #endif
00290
00298 #ifndef DO_ENABLE_OBJECT_TRACKING
00299 #if DO_FAT_VOBJ==1 && DO_USE_RUNTIME==1
00300 #define DO_ENABLE_OBJECT_TRACKING 1
00301 #else
00302 #define DO_ENABLE_OBJECT_TRACKING 0
00303 #endif
00304 #endif
00305
00313 #define DO_ENABLE_OPERATOR_DELETE 0
00314
00315
00316
00332 #if defined(__GNUC__) || \
00333 defined(__xlc__) || defined(__xlC__)
00334 #define DO_USE_DTOR_PADDING
00335 #endif
00336
00337 #ifdef DO_USE_DTOR_PADDING
00338 #define DO_VTABLE_DTOR_PADDING virtual void docall do_dtor_padding() { }
00339 #else
00340 #define DO_VTABLE_DTOR_PADDING
00341 #endif
00342
00343
00353 #ifndef DO_RETURN_STRUCT_WITH_DTOR_SAFE
00354 #define DO_RETURN_STRUCT_WITH_DTOR_SAFE 1
00355 #endif
00356
00357
00358
00362 #ifdef _MSC_VER
00363 #define DO_ADJUST_VOBJ_PTR
00364 #endif
00365
00366 #ifdef DO_ADJUST_VOBJ_PTR
00367 #define VOBJ_TO_VOID_PTR(pvo) ((void*)(pvo?(((char*)pvo)-sizeof(void*)):NULL))
00368 #define VOID_TO_VOBJ_PTR(pv) ((VObj*)(pv?(((char*)pv)+sizeof(void*)):NULL))
00369 #else
00370 #define VOBJ_TO_VOID_PTR(pvo) ((void*)pvo)
00371 #define VOID_TO_VOBJ_PTR(pv) ((VObj*)(void*)pv)
00372 #endif
00373
00374
00379 #ifndef DO_USE_TEMPLATES
00380 #define DO_USE_TEMPLATES 1
00381 #endif
00382
00383
00384 #ifndef DO_ASSERT_MSG
00385 #ifdef DO_USE_PIASSERT
00386
00387 #include "pi/Assert.h"
00388 #define DO_ASSERT_MSG(v,msg) piAssert(v,msg)
00389 #else
00390 #ifdef DO_DEBUG
00391 #include <assert.h>
00392 #define DO_ASSERT_MSG(v,msg) { if(!(v)){ DO_PUTS(msg); assert(0); } }
00393 #else
00394 #define DO_ASSERT_MSG(v,msg) { if(!(v)){ DO_PUTS(msg); } }
00395 #endif
00396 #endif
00397 #endif
00398
00402 #endif // DOSETUP_H