ReactOS 0.4.16-dev-340-g0540c21
section_attribs.h
Go to the documentation of this file.
1/*++ NDK Version: 0099
2
3Copyright (c) Alex Ionescu. All rights reserved.
4
5Header Name:
6
7 section_attribs.h
8
9Abstract:
10
11 Preprocessor definitions to put code and data into specific sections.
12
13Author:
14
15 Timo Kreuzer (timo.kreuzer@reactos.org)
16
17--*/
18
19#pragma once
20
21#if defined(__GNUC__) || defined(__clang__)
22
23#define DATA_SEG(segment) __attribute__((section(segment)))
24#define CODE_SEG(segment) __attribute__((section(segment)))
25
26#elif defined(_MSC_VER)
27
28#define DATA_SEG(segment) __declspec(allocate(segment))
29#define CODE_SEG(segment) __declspec(code_seg(segment))
30
31#else
32
33#error Invalid compiler!
34
35#endif