https://git.reactos.org/?p=reactos.git;a=commitdiff;h=18e835b605123fe9d4054…
commit 18e835b605123fe9d4054fa638c37e497bc43aba
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sun Jun 23 15:41:26 2019 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sat Jun 29 12:13:09 2019 +0200
[SDK] Fix build with sal.h
* sal.h: add file header, uncomment _Interlocked_operand_ and PAL_STDCPP_COMPAT guard
* When including stl headers, define PAL_STDCPP_COMPAT
---
sdk/cmake/CMakeMacros.cmake | 1 +
sdk/include/psdk/sal.h | 13 ++++++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/sdk/cmake/CMakeMacros.cmake b/sdk/cmake/CMakeMacros.cmake
index 80cd5b4dcd0..2acff80ec8b 100644
--- a/sdk/cmake/CMakeMacros.cmake
+++ b/sdk/cmake/CMakeMacros.cmake
@@ -74,6 +74,7 @@ macro(set_cpp)
include_directories(${REACTOS_SOURCE_DIR}/sdk/include/c++/stlport)
else()
replace_compile_flags("-nostdinc" " ")
+ add_definitions(-DPAL_STDCPP_COMPAT)
endif()
endif()
diff --git a/sdk/include/psdk/sal.h b/sdk/include/psdk/sal.h
index 06a7469783a..2fb7d3a2c8d 100644
--- a/sdk/include/psdk/sal.h
+++ b/sdk/include/psdk/sal.h
@@ -1,3 +1,10 @@
+/*
+ * PROJECT: ReactOS PSDK
+ * LICENSE: MIT (
https://spdx.org/licenses/MIT)
+ * PURPOSE: Standard Annotation Language (SAL) definitions
+ * COPYRIGHT: Microsoft Corporation.
+ * SOURCE:
https://github.com/microsoft/service-fabric/blob/master/src/prod/src/pal/sr…
+ */
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license
information.
@@ -2655,10 +2662,10 @@ buffer, use the table in the buffer annotations section.
*/
// These macros conflict with c++ headers.
-//#ifndef PAL_STDCPP_COMPAT
+#ifndef PAL_STDCPP_COMPAT
#define __in _SAL1_Source_(__in, (),
_In_)
#define __out _SAL1_Source_(__out, (),
_Out_)
-//#endif // !PAL_STDCPP_COMPAT
+#endif // !PAL_STDCPP_COMPAT
#define __ecount(size) _SAL1_Source_(__ecount,
(size), __notnull __elem_writableTo(size))
#define __bcount(size) _SAL1_Source_(__bcount,
(size), __notnull __byte_writableTo(size))
@@ -2941,7 +2948,7 @@ __PRIMOP(int, _In_function_class_(__In_impl_ char*);)
/*
* interlocked operand used in interlocked instructions
*/
-//#define _Interlocked_operand_ _Pre_ _SA_annotes0(SAL_interlocked)
+#define _Interlocked_operand_ _Pre_ _SA_annotes0(SAL_interlocked)
#define _Enum_is_bitflag_ _SA_annotes0(SAL_enumIsBitflag)
#define _Strict_type_match_ _SA_annotes0(SAL_strictType2)