Retro68/PEFTools/PEF.h

47 lines
1.3 KiB
C
Raw Normal View History

#ifndef PEF_H
#define PEF_H
/* Provide minimal definitions from ConfitionalMacros.h.
* ConditionalMacros.h can't deal with our host C compiler.
*/
#define __CONDITIONALMACROS__
#define TYPE_BOOL 1
#define EXTERN_API(x) x
#define EXTERN_API_C(x) x
#define CALLBACK_API(ret,name) ret (*name)
#define CALLBACK_API_C(ret,name) ret (*name)
#define ONEWORDINLINE(x)
#define FOUR_CHAR_CODE(x) (x)
#define PRAGMA_STRUCT_PACKPUSH 1
/* Can't use MacTypes.h either,
* as older versions are hardcoded to 32 bit platforms.
*/
#define __MACTYPES__
typedef uint8_t UInt8;
typedef int8_t SInt8;
typedef uint16_t UInt16;
typedef int16_t SInt16;
typedef uint32_t UInt32;
typedef int32_t SInt32;
typedef uint32_t OSType;
/* Definitions for PEF, from Apple's Universal Interfaces */
#include <PEFBinaryFormat.h>
/* Deal with differences between versions of PEFBinaryFormat.h */
#ifndef PEFRelocComposeSetPosition_1st
#define PEFRelocComposeSetPosition_1st(fullOffset) \
( 0xA000 | ((UInt16) (((UInt32)(fullOffset)) >> 16) ) )
#define PEFRelocComposeSetPosition_2nd(fullOffset) \
( (UInt16) ((UInt32)(fullOffset) & 0xFFFF) )
#define PEFRelocComposeLgByImport_1st(fullIndex) \
( 0xA400 | ((UInt16) (((UInt32)(fullIndex)) >> 16) ) )
#define PEFRelocComposeLgByImport_2nd(fullIndex) \
( (UInt16) ((UInt32)(fullIndex) & 0xFFFF) )
#endif
#endif // PEF_H