Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ IncludeCategories:
Priority: 3
- Regex: '^<WinIoCtl\.h>$'
Priority: 4
- Regex: '^<__.*\.hpp>$'
Priority: 2
- Regex: '\.hpp[>"]$'
Priority: 5
- Regex: '.*'
Priority: 2

Expand Down
3 changes: 2 additions & 1 deletion stl/src/StlCompareStringA.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include "awint.h"
#include <crtdbg.h>
#include <internal_shared.h>
#include <string.h>

#include <Windows.h>

#include "awint.hpp"


// int __cdecl __crtCompareStringA - Get type information about an ANSI string.
//
Expand Down
3 changes: 2 additions & 1 deletion stl/src/StlCompareStringW.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include "awint.h"
#include <crtdbg.h>
#include <internal_shared.h>
#include <string.h>

#include <Windows.h>

#include "awint.hpp"

// int __cdecl __crtCompareStringW - Get type information about a wide string.
//
// Purpose:
Expand Down
3 changes: 2 additions & 1 deletion stl/src/StlLCMapStringA.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include "awint.h"
#include <internal_shared.h>
#include <locale.h>

#include "awint.hpp"

// int __cdecl __crtLCMapStringA - Get type information about an ANSI string.
//
// Purpose:
Expand Down
3 changes: 2 additions & 1 deletion stl/src/StlLCMapStringW.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include "awint.h"
#include <internal_shared.h>
#include <locale.h>

#include "awint.hpp"

// int __cdecl __crtLCMapStringW - Get type information about a wide string.
//
// Purpose:
Expand Down
3 changes: 2 additions & 1 deletion stl/src/_tolower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@

#include <yvals.h>

#include "awint.h"
#include <ctype.h>
#include <internal_shared.h>
#include <locale.h>
#include <stddef.h>
#include <stdlib.h>
#include <xlocinfo.h>

#include "awint.hpp"

// remove macro definitions of _tolower() and tolower()
#undef _tolower
#undef tolower
Expand Down
3 changes: 2 additions & 1 deletion stl/src/_toupper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

#include <yvals.h>

#include "awint.h"
#include <ctype.h>
#include <locale.h>
#include <stddef.h>
#include <xlocinfo.h>

#include "awint.hpp"

// remove macro definitions of _toupper() and toupper()
#undef _toupper
#undef toupper
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion stl/src/cond.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@

// condition variable functions

#include "primitives.h"
#include <internal_shared.h>
#include <limits.h>
#include <stdlib.h>
#include <type_traits>
#include <xthreads.h>
#include <xtimec.h>

#include "primitives.hpp"

struct _Cnd_internal_imp_t { // condition variable implementation for ConcRT
std::aligned_storage_t<Concurrency::details::stl_condition_variable_max_size,
Concurrency::details::stl_condition_variable_max_alignment>
Expand Down
3 changes: 2 additions & 1 deletion stl/src/cthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

// thread functions

#include "awint.h"
#include <process.h>
#include <stdint.h>
#include <stdio.h>
Expand All @@ -13,6 +12,8 @@

#include <Windows.h>

#include "awint.hpp"

namespace {
using _Thrd_start_t = int (*)(void*);

Expand Down
3 changes: 2 additions & 1 deletion stl/src/dllmain.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include "awint.h"
#include <internal_shared.h>

#include <Windows.h>

#include "awint.hpp"

#ifdef _CRT_APP
// free static resource used by causality
extern "C" void __cdecl __crtCleanupCausalityStaticFactories();
Expand Down
3 changes: 2 additions & 1 deletion stl/src/filesys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@

#include <yvals.h>

#include "awint.h"
#include <direct.h>
#include <experimental/filesystem>
#include <io.h>
#include <string.h>

#include <Windows.h>

#include "awint.hpp"

_FS_BEGIN
static file_type _Map_mode(int _Mode) { // map Windows file attributes to file_status
constexpr int _File_attribute_regular =
Expand Down
3 changes: 2 additions & 1 deletion stl/src/mutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@

// mutex functions

#include "primitives.h"
#include <internal_shared.h>
#include <stdio.h>
#include <stdlib.h>
#include <type_traits>
#include <xthreads.h>
#include <xtimec.h>

#include "primitives.hpp"

extern "C" _CRTIMP2_PURE void _Thrd_abort(const char* msg) { // abort on precondition failure
fputs(msg, stderr);
fputc('\n', stderr);
Expand Down
3 changes: 2 additions & 1 deletion stl/src/primitives.h → stl/src/primitives.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
#pragma warning(disable : 4201) // nonstandard extension used: nameless struct/union
#pragma warning(disable : 4324) // structure was padded due to alignment specifier

#include "awint.h"
#include <crtdefs.h>
#include <exception>
#include <new>
#include <stdlib.h>

#include <Windows.h>

#include "awint.hpp"

#ifdef _STL_CONCRT_SUPPORT
#include <concrt.h>
#include <concrtinternal.h>
Expand Down
3 changes: 2 additions & 1 deletion stl/src/taskscheduler.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include "awint.h"
#include <condition_variable>
#include <mutex>
#include <ppltaskscheduler.h>
#include <stddef.h>

#include <Windows.h>

#include "awint.hpp"

#pragma warning(disable : 4074)
#pragma init_seg(compiler)

Expand Down
2 changes: 1 addition & 1 deletion stl/src/winapinls.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include "awint.h"
#include "awint.hpp"

#if _STL_WIN32_WINNT < _WIN32_WINNT_VISTA

Expand Down
20 changes: 10 additions & 10 deletions stl/src/winapisupp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Prevent clang-format from reordering <AppModel.h> before <Windows.h>
#include <Windows.h>
#include <AppModel.h>
#include "awint.h"
#include "awint.hpp"
#include <internal_shared.h>
#include <stdlib.h>
// clang-format on
Expand Down Expand Up @@ -415,51 +415,51 @@ extern "C" VOID __cdecl __crtInitializeConditionVariable(PCONDITION_VARIABLE con
DYNAMICGETCACHEDFUNCTION(
PFNINITIALIZECONDITIONVARIABLE, InitializeConditionVariable, pfInitializeConditionVariable);
pfInitializeConditionVariable(pCond);
// Don't have fallbacks because the only caller (in primitives.h) will check the existence before calling
// Don't have fallbacks because the only caller (in primitives.hpp) will check the existence before calling
}

extern "C" VOID __cdecl __crtWakeConditionVariable(PCONDITION_VARIABLE const pCond) {
DYNAMICGETCACHEDFUNCTION(PFNWAKECONDITIONVARIABLE, WakeConditionVariable, pfWakeConditionVariable);
pfWakeConditionVariable(pCond);
// Don't have fallbacks because the only caller (in primitives.h) will check the existence before calling
// Don't have fallbacks because the only caller (in primitives.hpp) will check the existence before calling
}

extern "C" VOID __cdecl __crtWakeAllConditionVariable(PCONDITION_VARIABLE const pCond) {
DYNAMICGETCACHEDFUNCTION(PFNWAKEALLCONDITIONVARIABLE, WakeAllConditionVariable, pfWakeAllConditionVariable);
pfWakeAllConditionVariable(pCond);
// Don't have fallbacks because the only caller (in primitives.h) will check the existence before calling
// Don't have fallbacks because the only caller (in primitives.hpp) will check the existence before calling
}

extern "C" BOOL __cdecl __crtSleepConditionVariableCS(
PCONDITION_VARIABLE const pCond, PCRITICAL_SECTION const pLock, DWORD const dwMs) {
DYNAMICGETCACHEDFUNCTION(PFNSLEEPCONDITIONVARIABLECS, SleepConditionVariableCS, pfSleepConditionVariableCS);
return pfSleepConditionVariableCS(pCond, pLock, dwMs);
// Don't have fallbacks because the only caller (in primitives.h) will check the existence before calling
// Don't have fallbacks because the only caller (in primitives.hpp) will check the existence before calling
}

extern "C" VOID __cdecl __crtInitializeSRWLock(PSRWLOCK const pLock) {
DYNAMICGETCACHEDFUNCTION(PFNINITIALIZESRWLOCK, InitializeSRWLock, pfInitializeSRWLock);
pfInitializeSRWLock(pLock);
// Don't have fallbacks because the only caller (in primitives.h) will check the existence before calling
// Don't have fallbacks because the only caller (in primitives.hpp) will check the existence before calling
}

extern "C" VOID __cdecl __crtAcquireSRWLockExclusive(PSRWLOCK const pLock) {
DYNAMICGETCACHEDFUNCTION(PFNACQUIRESRWLOCKEXCLUSIVE, AcquireSRWLockExclusive, pfAcquireSRWLockExclusive);
pfAcquireSRWLockExclusive(pLock);
// Don't have fallbacks because the only caller (in primitives.h) will check the existence before calling
// Don't have fallbacks because the only caller (in primitives.hpp) will check the existence before calling
}

extern "C" VOID __cdecl __crtReleaseSRWLockExclusive(PSRWLOCK const pLock) {
DYNAMICGETCACHEDFUNCTION(PFNRELEASESRWLOCKEXCLUSIVE, ReleaseSRWLockExclusive, pfReleaseSRWLockExclusive);
pfReleaseSRWLockExclusive(pLock);
// Don't have fallbacks because the only caller (in primitives.h) will check the existence before calling
// Don't have fallbacks because the only caller (in primitives.hpp) will check the existence before calling
}

extern "C" BOOL __cdecl __crtSleepConditionVariableSRW(
PCONDITION_VARIABLE const pCond, PSRWLOCK const pLock, DWORD const dwMs, ULONG const flags) {
DYNAMICGETCACHEDFUNCTION(PFNSLEEPCONDITIONVARIABLESRW, SleepConditionVariableSRW, pfSleepConditionVariableSRW);
return pfSleepConditionVariableSRW(pCond, pLock, dwMs, flags);
// Don't have fallbacks because the only caller (in primitives.h) will check the existence before calling
// Don't have fallbacks because the only caller (in primitives.hpp) will check the existence before calling
}

extern "C" PTP_WORK __cdecl __crtCreateThreadpoolWork(
Expand Down Expand Up @@ -494,7 +494,7 @@ extern "C" BOOL __cdecl __crtQueueUserWorkItem(LPTHREAD_START_ROUTINE, PVOID, UL
extern "C" BOOLEAN __cdecl __crtTryAcquireSRWLockExclusive(PSRWLOCK const pLock) {
DYNAMICGETCACHEDFUNCTION(PFNTRYACQUIRESRWLOCKEXCLUSIVE, TryAcquireSRWLockExclusive, pfTryAcquireSRWLockExclusive);
return pfTryAcquireSRWLockExclusive(pLock);
// Don't have fallbacks because the only caller (in primitives.h) will check the existence before calling
// Don't have fallbacks because the only caller (in primitives.hpp) will check the existence before calling
}

#endif // _STL_WIN32_WINNT < _WIN32_WINNT_WIN7
Expand Down
3 changes: 2 additions & 1 deletion stl/src/xalloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

// TRANSITION, ABI: The functions in this file are preserved for binary compatibility

#include "awint.h"
#include <stdexcept>

#include <Windows.h>

#include "awint.hpp"

namespace stdext {
namespace threads {

Expand Down
2 changes: 1 addition & 1 deletion stl/src/xcosh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// _Cosh function

#include "xmath.h"
#include "xmath.hpp"

_EXTERN_C_UNLESS_PURE

Expand Down
3 changes: 2 additions & 1 deletion stl/src/xdateord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

// look up date ordering

#include "awint.h"
#include <locale>

#include "awint.hpp"

_EXTERN_C_UNLESS_PURE

int __CLRCALL_PURE_OR_CDECL _Getdateorder() { // return date order for current locale
Expand Down
2 changes: 1 addition & 1 deletion stl/src/xdint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// _Dint function -- IEEE 754 version

#include "xmath.h"
#include "xmath.hpp"

_EXTERN_C_UNLESS_PURE

Expand Down
2 changes: 1 addition & 1 deletion stl/src/xdnorm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// _Dnorm function -- IEEE 754 version

#include "xmath.h"
#include "xmath.hpp"

_EXTERN_C_UNLESS_PURE

Expand Down
2 changes: 1 addition & 1 deletion stl/src/xdscale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// _Dscale function -- IEEE 754 version

#include "xmath.h"
#include "xmath.hpp"

_EXTERN_C_UNLESS_PURE

Expand Down
4 changes: 2 additions & 2 deletions stl/src/xdtento.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

// _Dtento function -- IEEE 754 version

#include "xxdftype.h"
#include "xxxdtent.h"
#include "xxdftype.hpp"
#include "xxxdtent.hpp"
2 changes: 1 addition & 1 deletion stl/src/xdtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// _Dtest function -- IEEE 754 version

#include "xmath.h"
#include "xmath.hpp"

_EXTERN_C_UNLESS_PURE

Expand Down
2 changes: 1 addition & 1 deletion stl/src/xdunscal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// _Dunscale function -- IEEE 754 version

#include "xmath.h"
#include "xmath.hpp"

_EXTERN_C_UNLESS_PURE

Expand Down
Loading