mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 06:05:48 +00:00
[NDK][CMAKE] Introduce DATA_SEG and CODE_SEG macro
These are for putting code and data to non-default sections At the same time, move INIT section attributes declaration to cmake files
This commit is contained in:
parent
ba447018c8
commit
658f742c2d
4 changed files with 9 additions and 15 deletions
|
@ -8,7 +8,7 @@ Header Name:
|
|||
|
||||
Abstract:
|
||||
|
||||
Preprocessor definitions to put code and data into the INIT section.
|
||||
Preprocessor definitions to put code and data into specific sections.
|
||||
|
||||
Author:
|
||||
|
||||
|
@ -20,19 +20,13 @@ Author:
|
|||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
|
||||
#define INIT_SECTION __attribute__((section ("INIT")))
|
||||
#define INIT_FUNCTION __attribute__((section ("INIT")))
|
||||
#define DATA_SEG(segment) __attribute__((section(segment)))
|
||||
#define CODE_SEG(segment) __attribute__((section(segment)))
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
|
||||
#pragma comment(linker, "/SECTION:INIT,ERW")
|
||||
#define INIT_SECTION __declspec(allocate("INIT"))
|
||||
#if (_MSC_VER >= 1800) // Visual Studio 2013 / version 12.0
|
||||
#define INIT_FUNCTION __declspec(code_seg("INIT"))
|
||||
#else
|
||||
#pragma section("INIT", read,execute,discard)
|
||||
#define INIT_FUNCTION
|
||||
#endif
|
||||
#define DATA_SEG(segment) __declspec(allocate(segment))
|
||||
#define CODE_SEG(segment) __declspec(code_seg(segment))
|
||||
|
||||
#else
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue