Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define DUMMY_STRUCT(line, tens, ones) struct DummyStruct_##line##_##tens##_##ones
- #define ONE_DUMMY_STRUCT(line, tens, ones) DUMMY_STRUCT(line, tens, ones)
- #define TEN_DUMMY_STRUCTS(line, index) \
- DUMMY_STRUCT(line, index, 0); \
- DUMMY_STRUCT(line, index, 1); \
- DUMMY_STRUCT(line, index, 2); \
- DUMMY_STRUCT(line, index, 3); \
- DUMMY_STRUCT(line, index, 4); \
- DUMMY_STRUCT(line, index, 5); \
- DUMMY_STRUCT(line, index, 6); \
- DUMMY_STRUCT(line, index, 7); \
- DUMMY_STRUCT(line, index, 8); \
- DUMMY_STRUCT(line, index, 9)
- // Macros which define dummy structs to increment the IDO block number for BSS ordering.
- #define INCREMENT_BLOCK_NUMBER_BY_1() ONE_DUMMY_STRUCT(__LINE__, 0, 0)
- #define INCREMENT_BLOCK_NUMBER_BY_10() TEN_DUMMY_STRUCTS(__LINE__, 0)
- #define INCREMENT_BLOCK_NUMBER_BY_100() \
- TEN_DUMMY_STRUCTS(__LINE__, 0); \
- TEN_DUMMY_STRUCTS(__LINE__, 1); \
- TEN_DUMMY_STRUCTS(__LINE__, 2); \
- TEN_DUMMY_STRUCTS(__LINE__, 3); \
- TEN_DUMMY_STRUCTS(__LINE__, 4); \
- TEN_DUMMY_STRUCTS(__LINE__, 5); \
- TEN_DUMMY_STRUCTS(__LINE__, 6); \
- TEN_DUMMY_STRUCTS(__LINE__, 7); \
- TEN_DUMMY_STRUCTS(__LINE__, 8); \
- TEN_DUMMY_STRUCTS(__LINE__, 9)
- // For retail BSS ordering, the block number of sMainThread must be 0 or
- // just above (the exact upper bound depends on the block numbers assigned to
- // extern variables declared in headers).
- #define FIX_MAIN_BSS() \
- INCREMENT_BLOCK_NUMBER_BY_10(); \
- INCREMENT_BLOCK_NUMBER_BY_10(); \
- INCREMENT_BLOCK_NUMBER_BY_10(); \
- INCREMENT_BLOCK_NUMBER_BY_10(); \
- INCREMENT_BLOCK_NUMBER_BY_10(); \
- INCREMENT_BLOCK_NUMBER_BY_10();
- // For retail BSS ordering, the block number of sFaultInstance must be 0 or
- // just above (the exact upper bound depends on the block numbers assigned to
- // extern variables declared in headers).
- #define FIX_FAULT_BSS() \
- INCREMENT_BLOCK_NUMBER_BY_10(); \
- INCREMENT_BLOCK_NUMBER_BY_10(); \
- #if !OOT_DEBUG
- INCREMENT_BLOCK_NUMBER_BY_1(); \
- INCREMENT_BLOCK_NUMBER_BY_1(); \
- INCREMENT_BLOCK_NUMBER_BY_1(); \
- INCREMENT_BLOCK_NUMBER_BY_1(); \
- INCREMENT_BLOCK_NUMBER_BY_1(); \
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement