00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _BUILDDEFAULTS_H_
00014 #define _BUILDDEFAULTS_H_
00015
00016 #include <BuildDefines.h>
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #if !defined(BUILD_TYPE)
00036 # error BUILD_TYPE MUST be defined.
00037 #endif
00038
00039
00040
00041
00042 #ifdef ERROR_CHECK_LEVEL
00043 #error "ERROR_CHECK_LEVEL is an obsolete build flag! - See BUILD_TYPE instead"
00044 #endif
00045
00046 #ifndef DEFAULT_LIB_ENTRIES
00047 #define DEFAULT_LIB_ENTRIES 12 // space for 12 libraries in library table
00048 #endif
00049
00050
00051
00052
00053 #ifndef DO_NOT_ALLOW_ACCESS_TO_INTERNALS_OF_STRUCTS
00054
00055 # define ALLOW_ACCESS_TO_INTERNALS_OF_CLIPBOARDS
00056 # define ALLOW_ACCESS_TO_INTERNALS_OF_CONTROLS
00057 # define ALLOW_ACCESS_TO_INTERNALS_OF_FIELDS
00058 # define ALLOW_ACCESS_TO_INTERNALS_OF_FINDPARAMS
00059 # define ALLOW_ACCESS_TO_INTERNALS_OF_FORMS
00060 # define ALLOW_ACCESS_TO_INTERNALS_OF_LISTS
00061 # define ALLOW_ACCESS_TO_INTERNALS_OF_MENUS
00062 # define ALLOW_ACCESS_TO_INTERNALS_OF_PROGRESS
00063 # define ALLOW_ACCESS_TO_INTERNALS_OF_SCROLLBARS
00064 # define ALLOW_ACCESS_TO_INTERNALS_OF_TABLES
00065
00066 # define ALLOW_ACCESS_TO_INTERNALS_OF_BITMAPS
00067 # define ALLOW_ACCESS_TO_INTERNALS_OF_FONTS
00068 # define ALLOW_ACCESS_TO_INTERNALS_OF_WINDOWS
00069
00070 #endif
00071
00072
00073
00074
00075
00076
00077
00078 # ifndef CPU_TYPE
00079 # if defined(__i386__) || defined(_M_IX86)
00080 # define CPU_TYPE CPU_x86
00081 # elif defined(__POWERPC__) || defined(__powerpc__)
00082 # define CPU_TYPE CPU_PPC
00083 # elif defined(__arm__) || defined(__arm)
00084 # define CPU_TYPE CPU_ARM
00085 # else
00086 # error "Unable to automatically define CPU_TYPE from existing predefined macros."
00087 # endif
00088 # endif // CPU_TYPE
00089
00090 #if CPU_TYPE != CPU_ARM && CPU_TYPE != CPU_x86 && CPU_TYPE != CPU_PPC
00091 # error "Unsupported CPU_TYPE - Only CPU_ARM and CPU_x86 are supported in this release."
00092 #endif
00093
00094 #ifndef CPU_ENDIAN
00095 # if (CPU_TYPE == CPU_x86) || (CPU_TYPE == CPU_ARM)
00096 # define CPU_ENDIAN CPU_ENDIAN_LITTLE
00097 # else
00098 # define CPU_ENDIAN CPU_ENDIAN_BIG
00099 # endif
00100 #endif
00101
00102 # ifndef BUS_ALIGN
00103 # if (CPU_TYPE == CPU_ARM) || (CPU_TYPE == CPU_x86) || (CPU_TYPE == CPU_PPC)
00104 # define BUS_ALIGN BUS_ALIGN_32
00105 # else
00106 # define BUS_ALIGN BUS_ALIGN_16
00107 # endif
00108 # endif
00109
00110
00111
00112 # if (BUS_ALIGN == BUS_ALIGN_16)
00113
00114
00115
00116 # define INCLUDE_ALIGN_16_STRUCT
00117 # endif
00118
00119
00120
00121
00122
00123 #ifndef BITFIELD_LAYOUT
00124 # if (CPU_TYPE == CPU_x86) || (CPU_TYPE == CPU_ARM)
00125 # define BITFIELD_LAYOUT LSB_TO_MSB
00126 # else
00127 # define BITFIELD_LAYOUT MSB_TO_LSB
00128 # endif
00129 #endif
00130
00131
00132
00133
00134 #if defined (__CC_ARM)
00135 #define MODULE_NAME __MODULE__
00136 #else
00137 #define MODULE_NAME __FILE__
00138 #endif
00139
00140
00141
00142 #ifdef __ARMCC_VERSION
00143 #define INLINE_FNC __inline
00144 #elif defined (_MSC_VER)
00145 #define INLINE_FNC __inline
00146 #elif defined (__MWERKS__)
00147 #define INLINE_FNC inline
00148 #elif defined (_PACC_VER)
00149 #define INLINE_FNC __inline
00150 #elif defined (__GNUC__)
00151 # ifdef __cplusplus
00152 #define INLINE_FNC inline // C++ syntax
00153 # else
00154 #define INLINE_FNC static inline // C99 syntax
00155 # endif
00156 #else
00157
00158 #warning No __inline available; linkage errors may arise
00159 #define INLINE_FNC
00160 #endif
00161 #define INLINE_FUNCTION INLINE_FNC
00162
00163
00164
00165 #ifdef __ARMCC_VERSION
00166 #define PURE_FUNCTION __pure
00167 #elif defined (_MSC_VER)
00168 #define PURE_FUNCTION
00169 #elif defined (__MWERKS__)
00170 #define PURE_FUNCTION
00171 #elif defined (_PACC_VER)
00172 #define PURE_FUNCTION __pure
00173 #elif defined (__GNUC__)
00174 #define PURE_FUNCTION
00175 #else
00176
00177 #warning No __pure available; linkage errors may arise
00178 #define PURE_FUNCTION
00179 #endif
00180
00181
00182
00183
00184
00185 #ifdef __ARMCC_VERSION
00186 #define PACKED __packed
00187 #elif defined(_MSC_VER) // MS VC++ Compiler
00188 #define PACKED
00189 #pragma warning( disable : 4103 ) // To remove "used #pragma pack to change alignment" warning
00190 #else
00191 #define PACKED
00192 #if defined (__GNUC__) && defined (__UNIX__)
00193 #pragma pack(1)
00194 #endif
00195 #endif
00196
00197
00198
00199 #ifdef __ARMCC_VERSION
00200 #define PACKED16 __packed
00201 #elif defined(_MSC_VER) // MS VC++ Compiler
00202 #define PACKED16
00203 #pragma warning( disable : 4103 ) // To remove "used #pragma pack to change alignment" warning
00204 #else
00205 #define PACKED16
00206 #if defined (__GNUC__) && defined (__UNIX__)
00207 #pragma pack(2)
00208 #endif
00209 #endif
00210
00211
00212
00213
00214
00215 #if defined (__ARMCC_VERSION) && (__ARMCC_VERSION / 10000 == 11)
00216 # define ADS11_COMPILER_BUG 1
00217 #endif
00218
00219 #if defined (__ARMCC_VERSION) && (__ARMCC_VERSION / 10000 == 12)
00220 # define ADS12_COMPILER_BUG 1
00221 #endif
00222
00223 #ifndef TARGET_PLATFORM
00224 # if defined(WIN32)
00225 # define TARGET_PLATFORM TARGET_PLATFORM_PALMSIM_WIN32
00226 # elif defined(__arm__) || defined(__arm) || defined(__ARMCC_VERSION)
00227 # define TARGET_PLATFORM TARGET_PLATFORM_DEVICE_ARM
00228 # elif defined(MACOS)
00229 # define TARGET_PLATFORM TARGET_PLATFORM_PALMSIM_MACOS
00230 # elif defined(LINUX)
00231 # define TARGET_PLATFORM TARGET_PLATFORM_PALMSIM_LINUX
00232 # endif
00233 #endif
00234
00235 #ifndef TARGET_PLATFORM
00236 # error TARGET_PLATFORM "is not specified in your project file and it's not possible to set a default value."
00237 #endif
00238
00239 #ifndef TARGET_HOST
00240 #define TARGET_HOST TARGET_HOST_PALMOS
00241 #endif
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252 #if !defined(LINUX_DEMO_HACK) && TARGET_PLATFORM == TARGET_PLATFORM_DEVICE_ARM
00253 # ifdef __ARMCC_VERSION
00254 # define KERNEL_TRAP(x) __swi(x)
00255 # define KERNEL_TRAP_INDIRECT(x) __swi_indirect(x)
00256 # define RETURN_STRUCT __value_in_regs
00257 # else
00258 # error Unsupported ARM compiler
00259 # endif
00260 #else
00261 # define KERNEL_TRAP(x)
00262 # define KERNEL_TRAP_INDIRECT(x)
00263 # define RETURN_STRUCT
00264 #endif
00265
00266
00267
00268 #ifndef _SUPPORTS_NAMESPACE
00269 #if defined(__CC_ARM) || (defined(_MSC_VER) && _MSC_VER < 1300)
00270
00271
00272 #define _SUPPORTS_NAMESPACE 0
00273 #else
00274 #define _SUPPORTS_NAMESPACE 1
00275 #endif
00276 #endif
00277
00278
00279
00280
00281 #if defined(__GNUC__) || defined(__EDG_RUNTIME_USES_NAMESPACES)
00282 #define _REQUIRES_NAMESPACE 1
00283 #else
00284 #define _REQUIRES_NAMESPACE 0
00285 #endif
00286
00287
00288
00289 #if _SUPPORTS_NAMESPACE || _REQUIRES_NAMESPACE
00290 #define B_NO_THROW (std::nothrow)
00291 #else
00292 #define B_NO_THROW (nothrow)
00293 #endif
00294
00295
00296
00297 #if _SUPPORTS_NAMESPACE || _REQUIRES_NAMESPACE
00298 #define B_SNS(x) x
00299 #else
00300 #define B_SNS(x)
00301 #endif
00302
00303
00304
00305 #if _SUPPORTS_NAMESPACE
00306 #define BNS(x) x
00307 #else
00308 #define BNS(x)
00309 #endif
00310
00311
00312 #ifndef _SUPPORTS_RTTI
00313 #if TARGET_HOST == TARGET_HOST_PALMOS
00314 #define _SUPPORTS_RTTI 0
00315 #else
00316 #define _SUPPORTS_RTTI 1
00317 #endif
00318 #endif
00319
00320
00321 #if _SUPPORTS_RTTI
00322 #define B_TYPEPTR(x) (&typeid(x))
00323 #define B_TYPENAME(x) typeid(x).name()
00324 #else
00325 #define B_TYPEPTR(x) ((const type_info*)NULL)
00326 #define B_TYPENAME(x) ""
00327 #endif
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351 #if (TARGET_HOST == TARGET_HOST_WIN32)
00352 #define _EXPORT __declspec(dllexport)
00353 #define _IMPORT __declspec(dllimport)
00354 #else
00355 #define _EXPORT
00356 #define _IMPORT
00357 #endif
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382 #ifdef _MSC_VER
00383 #pragma warning(disable : 4200)
00384 #pragma warning(disable : 4201)
00385 #pragma warning(disable : 4100)
00386 #pragma warning(disable : 4152)
00387 #pragma warning(disable : 4218)
00388 #pragma warning(disable : 4204)
00389
00390 #pragma warning(disable : 4127)
00391 #pragma warning(disable : 4054)
00392 #pragma warning(disable : 4214)
00393 #pragma warning(disable : 4068)
00394 #endif
00395
00396
00397
00398
00399
00400 #ifdef MEMORY_FORCE_LOCK
00401 #error "MEMORY_FORCE_LOCK is an obsolete build flag!"
00402 #endif
00403
00404 #ifdef MODEL
00405 #error "MODEL is an obsolete build flag!"
00406 #endif
00407
00408 #ifdef USER_MODE
00409 #error "USER_MODE is an obsolete build flag!"
00410 #endif
00411
00412 #ifdef INTERNAL_COMMANDS
00413 #error "INTERNAL_COMMANDS is an obsolete build flag!"
00414 #endif
00415
00416 #ifdef INCLUDE_DES
00417 #error "INCLUDE_DES is an obsolete build flag!"
00418 #endif
00419
00420 #ifdef RESOURCE_FILE_PREFIX
00421 #error "RESOURCE_FILE_PREFIX is an obsolete build flag!"
00422 #endif
00423
00424 #ifdef SHELL_COMMAND_DB
00425 #error "SHELL_COMMAND_DB is an obsolete build flag!"
00426 #endif
00427
00428 #ifdef SHELL_COMMAND_UI
00429 #error "SHELL_COMMAND_UI is an obsolete build flag!"
00430 #endif
00431
00432 #ifdef SHELL_COMMAND_APP
00433 #error "SHELL_COMMAND_APP is an obsolete build flag!"
00434 #endif
00435
00436 #ifdef SHELL_COMMAND_EMULATOR
00437 #error "SHELL_COMMAND_EMULATOR is an obsolete build flag!"
00438 #endif
00439
00440 #ifdef CML_ENCODER
00441 #error "CML_ENCODER is an obsolete build flag!"
00442 #endif
00443
00444 #ifdef EMULATION_LEVEL
00445 #error "EMULATION_LEVEL is an obsolete build flag!"
00446 #endif
00447
00448 #ifdef PLATFORM_TYPE
00449 #error "PLATFORM_TYPE is an obsolete build flag!"
00450 #endif
00451
00452 #ifdef USE_TRAPS
00453 #error "USE_TRAPS is an obsolete build flag!"
00454 #endif
00455
00456 #ifdef ENVIRONMENT
00457 #error "ENVIRONMENT is an obsolete build flag!"
00458 #endif
00459
00460 #ifdef MODEL
00461 #error "MODEL is an obsolete build flag!"
00462 #endif
00463
00464 #ifdef DISABLE_HAL_TRAPS
00465 #error "DISABLE_HAL_TRAPS is an obsolete build flag!"
00466 #endif
00467
00468 #ifdef _DONT_USE_FP_TRAPS_
00469 #error "_DONT_USE_FP_TRAPS_ is an obsolete build flag!"
00470 #endif
00471
00472 #ifdef _DONT_USE_FP_TRAPSE_
00473 #error "_DONT_USE_FP_TRAPSE_ is an obsolete build flag!"
00474 #endif
00475
00476 #ifdef RUNTIME_MODEL
00477 #error "RUNTIME_MODEL is an obsolete build flag!"
00478 #endif
00479
00480 #ifdef MEMORY_TYPE
00481 #error "MEMORY_TYPE is an obsolete build flag!"
00482 #endif
00483
00484 #ifdef DAL_DEVELOPMENT
00485 #error "DAL_DEVELOPMENT is an obsolete build flag!"
00486 #endif
00487
00488 #ifdef DYN_MEM_SIZE_MAX
00489 #error "DYN_MEM_SIZE_MAX is an obsolete build flag!"
00490 #endif
00491
00492 #ifdef SMALL_ROM_SIZE
00493 #error "SMALL_ROM_SIZE is an obsolete build flag!"
00494 #endif
00495
00496 #ifdef CONSOLE_SERIAL_LIB
00497 #error "CONSOLE_SERIAL_LIB is an obsolete build flag!"
00498 #endif
00499
00500 #ifdef PILOT_SERIAL_MGR
00501 #error "PILOT_SERIAL_MGR is an obsolete build flag!"
00502 #endif
00503
00504 #ifdef MEMORY_VERSION
00505 #error "MEMORY_VERSION is an obsolete build flag!"
00506 #endif
00507
00508 #ifdef GRAPHICS_VERSION
00509 #error "GRAPHICS_VERSION is an obsolete build flag!"
00510 #endif
00511
00512 #ifdef HW_TARGET
00513 #error "HW_TARGET is an obsolete build flag!"
00514 #endif
00515
00516 #ifdef HW_REV
00517 #error "HW_REV is an obsolete build flag!"
00518 #endif
00519
00520 #ifdef RMP_LIB_INCLUDE
00521 #error "RMP_LIB_INCLUDE is an obsolete build flag!"
00522 #endif
00523
00524 #ifdef OEM_PRODUCT
00525 #error "OEM_PRODUCT is an obsolete build flag!"
00526 #endif
00527
00528 #ifdef LANGUAGE
00529 #error "LANGUAGE is an obsolete build flag!"
00530 #endif
00531
00532 #ifdef COUNTRY
00533 #error "COUNTRY is an obsolete build flag!"
00534 #endif
00535
00536 #ifdef LOCALE
00537 #error "LOCALE is an obsolete build flag!"
00538 #endif
00539
00540
00541
00542
00543
00544
00545
00546 #ifndef TRACE_OUTPUT
00547 # if BUILD_TYPE == BUILD_TYPE_DEBUG
00548 # define TRACE_OUTPUT TRACE_OUTPUT_ON
00549 # endif
00550 #endif
00551
00552
00553
00554
00555
00556
00557 #endif // __BUILDDEFAULTS_H__