Files
mac-sdk/include/ConditionalMacros.h
Claude 7e113199af Keep Toolbox calls apart from program functions of the same name
On PowerPC the headers now give each Toolbox function the symbol
__imp_<name> (MAC_IMPORT). peflink sends __imp_X to a program
definition of __imp_X, else to the import X, else to the program's own
X. Thus a program that defines a Win32 ShowWindow or MoveWindow still
calls the Toolbox ShowWindow from code that includes the Mac headers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRTDFNgD4oK9xbDsEGn
2026-11-26 01:59:50 +00:00

70 lines
2.3 KiB
C

/* ConditionalMacros.h: which compiler, CPU and runtime. Generated by
tools/gen-headers.py. */
#ifndef __CONDITIONALMACROS__
#define __CONDITIONALMACROS__
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#if defined(__m68k__)
# define TARGET_CPU_68K 1
# define TARGET_CPU_PPC 0
# define TARGET_RT_MAC_CFM 0
# define TARGET_RT_MAC_68881 0
# define M68K_INLINE(...) __attribute__((__raw_inline__(__VA_ARGS__)))
# define MAC_IMPORT(name)
# define GetCurrentArchitecture() ((ISAType)0)
#elif defined(__powerpc__) || defined(__ppc__)
# define TARGET_CPU_68K 0
# define TARGET_CPU_PPC 1
# define TARGET_RT_MAC_CFM 1
# define M68K_INLINE(...)
# define MAC_IMPORT(name) __asm__("__imp_" #name)
# define GetCurrentArchitecture() ((ISAType)1)
#else
# error "classic Mac OS headers: unknown CPU"
#endif
#define TARGET_OS_MAC 1
#define TARGET_RT_BIG_ENDIAN 1
#define TARGET_RT_LITTLE_ENDIAN 0
#ifndef TARGET_API_MAC_CARBON
# define TARGET_API_MAC_CARBON 0
#endif
#ifndef TARGET_API_MAC_OS8
# define TARGET_API_MAC_OS8 (!TARGET_API_MAC_CARBON)
#endif
#ifndef OLDROUTINENAMES
# define OLDROUTINENAMES 0
#endif
#ifndef pascal
# define pascal
#endif
/* Opt-in checks against the oldest System a program supports: build with
-DMAC_MIN_SYSTEM=0x0605 (for example) to get a warning at each call whose
trap no measured System older than that implements, and add
-DMAC_NO_COLOR_QD to also warn about calls only Color QuickDraw Macs
have. docs/systems.md lists the measurements. Calls you guard with
TrapAvailable() or Gestalt still warn; silence those with
#pragma clang diagnostic ignored "-Wuser-defined-warnings". */
#if defined(MAC_MIN_SYSTEM)
# define MAC_SINCE(v, s) __attribute__((__diagnose_if__(MAC_MIN_SYSTEM < (v), "needs System " s " or later", "warning")))
# define MAC_SINCE_GESTALT(v, s, g) __attribute__((__diagnose_if__(MAC_MIN_SYSTEM < (v), "needs a manager Gestalt selector " g " reports; the oldest measured System that had it is " s, "warning")))
#else
# define MAC_SINCE(v, s)
# define MAC_SINCE_GESTALT(v, s, g)
#endif
#if defined(MAC_NO_COLOR_QD)
# define MAC_COLOR_QD __attribute__((__diagnose_if__(1, "needs a Color QuickDraw Mac (Mac II or later)", "warning")))
#else
# define MAC_COLOR_QD
#endif
#define nil NULL
typedef struct RoutineDescriptor *ProcPtr;
#endif