mirror of
https://github.com/reactos/reactos.git
synced 2026-06-02 01:11:03 +08: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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user