mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 05:43:08 +00:00
[NDK][NTOS] Add global definition of INIT_FUNCTION/INIT_SECTION (#779)
* Add an NDK header to define INIT_FUNCTION/INIT_SECTION globally * Use _declspec(allocate(x)) and _declspec(code_seg(x)) on MSVC versions that support it * Use INIT_FUNCTION on functions only and INIT_SECTION on data only (required by MSVC) * Place INIT_FUNCTION before the return type (required by MSVC) * Make sure declarations and implementations share the same modifiers (required by MSVC) * Add a global linker option to suppress warnings about defined but unused INIT section * Merge INIT section into .text in freeldr
This commit is contained in:
parent
7c66247343
commit
71fefa32db
108 changed files with 522 additions and 296 deletions
|
@ -51,6 +51,7 @@ NTAPI
|
|||
EngGetLDEV(
|
||||
PDEVMODEW pdm);
|
||||
|
||||
INIT_FUNCTION
|
||||
NTSTATUS
|
||||
APIENTRY
|
||||
DriverEntry (
|
||||
|
|
|
@ -904,7 +904,7 @@ DriverUnload(IN PDRIVER_OBJECT DriverObject)
|
|||
/*
|
||||
* This definition doesn't work
|
||||
*/
|
||||
INIT_SECTION
|
||||
INIT_FUNCTION
|
||||
NTSTATUS
|
||||
APIENTRY
|
||||
DriverEntry(
|
||||
|
|
|
@ -10,14 +10,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define INIT_SECTION __attribute__((section ("INIT")))
|
||||
#define INIT_FUNCTION INIT_SECTION
|
||||
#else
|
||||
#define INIT_SECTION /* Done via alloc_text for MSC */
|
||||
#define INIT_FUNCTION INIT_SECTION
|
||||
#endif
|
||||
|
||||
/* Enable debugging features */
|
||||
#define GDI_DEBUG 0
|
||||
#define DBG_ENABLE_GDIOBJ_BACKTRACES 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue