From 23651b2d2cfef98dfc8ca3a988e642bd6dde2db6 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 14 Apr 2021 04:19:29 +0100 Subject: [PATCH] Define type for old versions of CodeWarrior. --- setter/src/macos/macos.h | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/setter/src/macos/macos.h b/setter/src/macos/macos.h index e381062..036202f 100644 --- a/setter/src/macos/macos.h +++ b/setter/src/macos/macos.h @@ -25,8 +25,6 @@ Copyright (C) 2011-2021 Natalia Portillo #ifndef AARU_FSTESTER_SETTER_SRC_MACOS_H #define AARU_FSTESTER_SETTER_SRC_MACOS_H -#include - // Things not included in Retro68 #if defined(HAVE_MULTIVERSE_H) #include "retro68.h" @@ -42,4 +40,34 @@ enum rtVersion = FOUR_CHAR_CODE('vers'), }; +#if __MWERKS__ <= 0x2100 + +// There's no MacTypes.h in old CodeWarrior +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef short int16_t; +typedef unsigned short uint16_t; +typedef long int32_t; +typedef unsigned long uint32_t; +typedef long long int64_t; +typedef unsigned long long uint64_t; + +#define kHasNoINITs (0x0080) /* Files only (Extensions/Control Panels only) */ + +#if __MWERKS__ <= 0x1800 +// Old CodeWarrior C library does not include snprintf() +int snprintf(char *str, size_t size, const char *format, ...); +#endif + +enum +{ + gestaltHasHFSPlusAPIs = 12 /* file system supports HFS Plus APIs */ +}; + +#define PBXGetVolInfo(pb, async) ((async) ? PBXGetVolInfoAsync(pb) : PBXGetVolInfoSync(pb)) + +#else +#include +#endif + #endif