reactos/sdk/include/ndk/section_attribs.h
Victor Perevertkin 658f742c2d
[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
2020-11-02 21:27:06 +03:00

35 lines
616 B
C

/*++ NDK Version: 0099
Copyright (c) Alex Ionescu. All rights reserved.
Header Name:
section_attribs.h
Abstract:
Preprocessor definitions to put code and data into specific sections.
Author:
Timo Kreuzer (timo.kreuzer@reactos.org)
--*/
#pragma once
#if defined(__GNUC__) || defined(__clang__)
#define DATA_SEG(segment) __attribute__((section(segment)))
#define CODE_SEG(segment) __attribute__((section(segment)))
#elif defined(_MSC_VER)
#define DATA_SEG(segment) __declspec(allocate(segment))
#define CODE_SEG(segment) __declspec(code_seg(segment))
#else
#error Invalid compiler!
#endif