44 lines
965 B
C++
44 lines
965 B
C++
#pragma once
|
|
|
|
#ifndef __GNUC__
|
|
#error Failed to create target macros. Compiler is not GCC.
|
|
#endif
|
|
|
|
#define NOINLINE [[gnu::noinline]]
|
|
#define ALWAYS_INLINE [[gnu::always_inline]]
|
|
|
|
#ifdef __arm__
|
|
|
|
#define TARGET_ARM_MODE _Pragma("GCC push_options") _Pragma("GCC target(\"arm\")")
|
|
#define TARGET_THUMB_MODE _Pragma("GCC push_options") _Pragma("GCC target(\"thumb\")")
|
|
#define TARGET_END_MODE _Pragma("GCC pop_options")
|
|
#define ARM_MODE [[gnu::target("arm")]]
|
|
#define THUMB_MODE [[gnu::target("thumb")]]
|
|
|
|
#else
|
|
|
|
#define TARGET_ARM_MODE
|
|
#define TARGET_THUMB_MODE
|
|
#define TARGET_END_MODE
|
|
#define ARM_MODE
|
|
#define THUMB_MODE
|
|
|
|
#endif
|
|
|
|
#ifdef __GBA__
|
|
|
|
#define GBA_IWRAM [[gnu::section(".iwram"), gnu::long_call]]
|
|
#define GBA_EWRAM [[gnu::section(".ewram"), gnu::long_call]]
|
|
#define GBA_IWRAM_DATA [[gnu::section(".iwram")]]
|
|
#define GBA_EWRAM_DATA [[gnu::section(".ewram")]]
|
|
|
|
#else
|
|
|
|
#define GBA_IWRAM
|
|
#define GBA_EWRAM
|
|
#define GBA_IWRAM_DATA
|
|
#define GBA_EWRAM_DATA
|
|
|
|
#endif
|
|
|