mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.7 KiB
49 lines
1.7 KiB
#define DUK_USE_DATE_NOW_GETTIMEOFDAY
|
|
#define DUK_USE_DATE_TZO_GMTIME_R
|
|
#define DUK_USE_DATE_PRS_STRPTIME
|
|
#define DUK_USE_DATE_FMT_STRFTIME
|
|
#include <TargetConditionals.h>
|
|
#include <architecture/byte_order.h>
|
|
#include <sys/param.h>
|
|
#include <sys/time.h>
|
|
#include <time.h>
|
|
|
|
/* http://stackoverflow.com/questions/5919996/how-to-detect-reliably-mac-os-x-ios-linux-windows-in-c-preprocessor */
|
|
/* https://stackoverflow.com/questions/12132933/preprocessor-macro-for-os-x-targets */
|
|
/* Some of the combinations below probably don't actually exist
|
|
* (like macOS simulator) but include them for completeness.
|
|
*/
|
|
#if TARGET_OS_SIMULATOR && TARGET_OS_MACCATALYST
|
|
#define DUK_USE_OS_STRING "catalyst-sim"
|
|
#elif TARGET_OS_SIMULATOR && TARGET_OS_BRIDGE
|
|
#define DUK_USE_OS_STRING "bridgeos-sim"
|
|
#elif TARGET_OS_SIMULATOR && TARGET_OS_WATCH
|
|
#define DUK_USE_OS_STRING "watchos-sim"
|
|
#elif TARGET_OS_SIMULATOR && TARGET_OS_TV
|
|
#define DUK_USE_OS_STRING "tvos-sim"
|
|
#elif TARGET_OS_SIMULATOR && TARGET_OS_IOS
|
|
#define DUK_USE_OS_STRING "ios-sim"
|
|
#elif TARGET_IPHONE_SIMULATOR && TARGET_OS_IOS /* deprecated */
|
|
#define DUK_USE_OS_STRING "ios-sim"
|
|
#elif TARGET_OS_SIMULATOR && TARGET_OS_MAC
|
|
#define DUK_USE_OS_STRING "macos-sim"
|
|
#elif TARGET_OS_MACCATALYST
|
|
#define DUK_USE_OS_STRING "catalyst"
|
|
#elif TARGET_OS_BRIDGE
|
|
#define DUK_USE_OS_STRING "bridgeos"
|
|
#elif TARGET_OS_WATCH
|
|
#define DUK_USE_OS_STRING "watchos"
|
|
#elif TARGET_OS_TV
|
|
#define DUK_USE_OS_STRING "tvos"
|
|
#elif TARGET_OS_IOS
|
|
#define DUK_USE_OS_STRING "ios"
|
|
#elif TARGET_OS_MAC
|
|
#define DUK_USE_OS_STRING "macos"
|
|
#else
|
|
#define DUK_USE_OS_STRING "osx-unknown"
|
|
#endif
|
|
|
|
/* Use _setjmp() on Apple by default, see GH-55. */
|
|
#define DUK_JMPBUF_TYPE jmp_buf
|
|
#define DUK_SETJMP(jb) _setjmp((jb))
|
|
#define DUK_LONGJMP(jb) _longjmp((jb), 1)
|
|
|