[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
This commit is contained in:
Timo Kreuzer 2019-06-23 15:41:26 +02:00
parent 00c8ac9af7
commit 18e835b605
2 changed files with 11 additions and 3 deletions

View file

@ -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()

View file

@ -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/src/internal/rt/sal.h
*/
// ------------------------------------------------------------
// 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)