Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove remaining CRT PAL wrappers and enable including standard headers in the CoreCLR build #98336

Merged
merged 68 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
ffee875
Remove PAL_exit as the only usages are in places where we don't use P…
jkoritzinsky Feb 12, 2024
04ea4b4
Remove rand PAL API as no one uses it.
jkoritzinsky Feb 12, 2024
2527c50
Remove PAL_realloc as no usage of it would ever pass an alloc size of 0.
jkoritzinsky Feb 12, 2024
610d49f
Remove PAL_free as it just forwards to free.
jkoritzinsky Feb 12, 2024
6f5d947
Remove malloc PAL API and update the few places that could have passe…
jkoritzinsky Feb 12, 2024
33f3224
Remove AMD64 processor PAL functions
jkoritzinsky Feb 12, 2024
86f4ea7
Remove time PAL as it's unused
jkoritzinsky Feb 12, 2024
865eefb
Explicitly use the PAL's getenv implementation in the few places we w…
jkoritzinsky Feb 12, 2024
188b02d
Suppress bad static-analysis warning
jkoritzinsky Feb 12, 2024
57e6a10
Remove bsearch and qsort PAL APIs as they only forward to the underly…
jkoritzinsky Feb 12, 2024
b528590
Remove CRT PAL, CLR STL PAL, and enable including CRT and STL headers.
jkoritzinsky Feb 13, 2024
309e330
Various changes to fix the Windows build.
jkoritzinsky Feb 13, 2024
108f83d
Remove min/max macros from NativeAOT and fix other build failures on …
jkoritzinsky Feb 13, 2024
16a04e0
Remove duplicate definitions, fix callconv build failure. Disable war…
jkoritzinsky Feb 13, 2024
d8afe1d
Force C++ linkage when including the C++ standard headers (some files…
jkoritzinsky Feb 16, 2024
e8c8846
Add missing includes/usings.
jkoritzinsky Feb 16, 2024
ce1f3e3
Fix some build errors
jkoritzinsky Feb 20, 2024
03963c5
Merge branch 'main' of github.com:dotnet/runtime into misc-pal
jkoritzinsky Feb 20, 2024
c7e6dc3
Remove malloc wrapper and simplify InternalNew
jkoritzinsky Feb 20, 2024
03a06fb
Remove cruntime/misc.cpp PAL APIs and inline usages of _gcvt_s
jkoritzinsky Feb 20, 2024
54d2c8e
Fix more build failures
jkoritzinsky Feb 20, 2024
90ad1fe
Fix various build failures.
jkoritzinsky Feb 23, 2024
a024484
Fix various build failures.
jkoritzinsky Feb 26, 2024
d3aec5e
Fix define and fix more community-leg failures.
jkoritzinsky Feb 26, 2024
27fd400
Various osx and gcc fixes
jkoritzinsky Mar 8, 2024
0c4e83a
Merge branch 'main' of github.com:dotnet/runtime into misc-pal
jkoritzinsky Mar 8, 2024
5cfe483
Define RC_INVOKED when preprocessing RC files and fix more NULL->TADD…
jkoritzinsky Mar 8, 2024
d49ae0c
Disable the NULL arithmetic and conversion warnings in CoreCLR to avo…
jkoritzinsky Mar 11, 2024
75529ac
One more malloc header fix.
jkoritzinsky Mar 11, 2024
83a4d19
Various build fixes/adjustments
jkoritzinsky Mar 11, 2024
2d195d1
Further build fixes
jkoritzinsky Mar 11, 2024
110965d
Apply format patch
jkoritzinsky Mar 11, 2024
141f08c
Fix GCC build and continue to work on the linux-x86 build
jkoritzinsky Mar 12, 2024
ab910e6
Ensure that we're doing an unsigned compare with the result of unsign…
jkoritzinsky Mar 12, 2024
2ae3160
Remove malloc.h include except for where we're pulling it in for _alloca
jkoritzinsky Mar 12, 2024
2e45f86
Undo unsigned largestAlignmentRequirement
jkoritzinsky Mar 12, 2024
a11db1d
Explicitly use the C++ abs signature as we did in the rest of the jit
jkoritzinsky Mar 12, 2024
bae9c94
Merge branch 'main' of github.com:dotnet/runtime into misc-pal
jkoritzinsky Mar 12, 2024
cf9efb2
Remove constant manipulation as that wasn't the problem and add missi…
jkoritzinsky Mar 13, 2024
eb0180d
Include malloc.h on windows for the whole JIT
jkoritzinsky Mar 13, 2024
fb30172
Fix PAL tests and update pal test script's usage information.
jkoritzinsky Mar 14, 2024
93c34c4
Remove PAL_STDCPP_COMPAT and remove min/max macro in the GC space and…
jkoritzinsky Mar 14, 2024
d5b82a1
Merge branch 'main' of github.com:dotnet/runtime into misc-pal
jkoritzinsky Mar 14, 2024
1a0ee6c
Various build fixes and PR feedback
jkoritzinsky Mar 14, 2024
57ed663
Fix build errors
jkoritzinsky Mar 14, 2024
705bf68
Set NOMINMAX globally and move the CoreCLR and NativeAOT builds to ne…
jkoritzinsky Mar 15, 2024
12a6143
Move standard headers to the top to avoid having the "debug return" m…
jkoritzinsky Mar 15, 2024
a686376
Use `set_property` to append the RC_INVOKED define instead of overwri…
jkoritzinsky Mar 15, 2024
cef5418
Undef __fastcall to fix FreeBSD
jkoritzinsky Mar 15, 2024
23f2792
Merge branch 'main' of github.com:dotnet/runtime into misc-pal
jkoritzinsky Mar 15, 2024
283f254
Add more min/max casts to fix GCC build.
jkoritzinsky Mar 15, 2024
ee084ec
Add more casts to fix GCC and windows x86 builds
jkoritzinsky Mar 15, 2024
aa54b3f
More min/max fixes...
jkoritzinsky Mar 15, 2024
03b42c6
More signedness mismatch fixes in gc.
jkoritzinsky Mar 18, 2024
80c56da
Remove USE_STL
jkoritzinsky Apr 1, 2024
0092a92
PR feedback
jkoritzinsky Apr 1, 2024
93be569
Remove custom min/max from SuperPMI
jkoritzinsky Apr 1, 2024
5dddd14
Remove custom min/max from the JIT
jkoritzinsky Apr 1, 2024
f9647e5
Remove min/max in the GC
jkoritzinsky Apr 1, 2024
25c9976
Fix more cases that only pop in 64-bit windows builds.
jkoritzinsky Apr 2, 2024
7315beb
Fix failures on linux-x64 and when using a compiler that can actually…
jkoritzinsky Apr 2, 2024
3b8e067
Merge branch 'main' of github.com:dotnet/runtime into misc-pal
jkoritzinsky Apr 2, 2024
e71df2d
Fix build
jkoritzinsky Apr 2, 2024
140313a
PR feedback
jkoritzinsky Apr 3, 2024
e9c5d90
Merge branch 'main' of github.com:dotnet/runtime into misc-pal
jkoritzinsky Apr 3, 2024
fca86d3
Convert (TADDR)NULL to (TADDR)0 in places where (TADDR)NULL was not a…
jkoritzinsky Apr 3, 2024
3701d49
Merge dotnet/runtime into jkoritzinsky/misc-pal
jkoritzinsky Apr 3, 2024
a0e2e3d
Merge branch 'main' of github.com:dotnet/runtime into misc-pal
jkoritzinsky Apr 3, 2024
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
1 change: 0 additions & 1 deletion eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ if (CLR_CMAKE_HOST_UNIX)
add_compile_options(-Wno-null-conversion)
add_compile_options(-glldb)
else()
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Werror=conversion-null>)
add_compile_options(-g)
endif()
endif()
Expand Down
6 changes: 6 additions & 0 deletions eng/native/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ endfunction(convert_to_absolute_path)
function(preprocess_file inputFilename outputFilename)
get_compile_definitions(PREPROCESS_DEFINITIONS)
get_include_directories(PREPROCESS_INCLUDE_DIRECTORIES)
get_source_file_property(SOURCE_FILE_DEFINITIONS ${inputFilename} COMPILE_DEFINITIONS)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this was a compensation for the COMPILE_DEFINITIONS property that you have fixed based on my feedback. Or is this something else?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The get_source_file_property was added to enable getting source-file-specific definitions. In particular, RC_INVOKED. The code your feedback was on was the pair to this line.


foreach(DEFINITION IN LISTS SOURCE_FILE_DEFINITIONS)
list(APPEND PREPROCESS_DEFINITIONS -D${DEFINITION})
endforeach()

if (MSVC)
add_custom_command(
OUTPUT ${outputFilename}
Expand Down
13 changes: 7 additions & 6 deletions src/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,12 @@ if(CLR_CMAKE_HOST_UNIX)
add_subdirectory(debug/createdump)
endif(CLR_CMAKE_HOST_OSX OR (CLR_CMAKE_HOST_LINUX AND NOT CLR_CMAKE_HOST_UNIX_X86 AND NOT CLR_CMAKE_HOST_ANDROID))

# Include the dummy c++ include files
include_directories("pal/inc/rt/cpp")

# This prevents inclusion of standard C compiler headers
add_compile_options(-nostdinc)
# The CoreCLR PAL used to redefine NULL, which caused a number of null conversion and arithmetic
# warnings and errors to be suppressed.
# Suppress these warnings here to avoid breaking the build.
add_compile_options($<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wno-null-arithmetic>)
janvorli marked this conversation as resolved.
Show resolved Hide resolved
add_compile_options($<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wno-conversion-null>)
add_compile_options($<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wno-pointer-arith>)

set (NATIVE_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/nativeresources)
include_directories(${NATIVE_RESOURCE_DIR})
Expand All @@ -218,7 +219,7 @@ if(CLR_CMAKE_HOST_UNIX)
# given Windows .rc file. The target C++ file path is returned in the
# variable specified by the TARGET_FILE parameter.
function(build_resources SOURCE TARGET_NAME TARGET_FILE)

set_property(SOURCE ${SOURCE} APPEND PROPERTY COMPILE_DEFINITIONS "RC_INVOKED")
set(PREPROCESSED_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.rc.i)

preprocess_file(${SOURCE} ${PREPROCESSED_SOURCE})
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/binder/assemblyname.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
//
// ============================================================

#include "common.h"
#include "assemblyname.hpp"
#include "assemblybindercommon.hpp"

#include "common.h"
#include "utils.hpp"

#include "textualidentityparser.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/clrdefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ if(CLR_CMAKE_HOST_WIN32)
add_definitions(-D_WIN32_WINNT=0x0602)
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_compile_definitions(NOMINMAX)
janvorli marked this conversation as resolved.
Show resolved Hide resolved
endif(CLR_CMAKE_HOST_WIN32)

if (NOT (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_UNIX))
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/debug/createdump/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ else(CLR_CMAKE_HOST_WIN32)
endif(CLR_CMAKE_HOST_OSX)
endif (CORECLR_SET_RPATH)

add_definitions(-DPAL_STDCPP_COMPAT)

# This is so we can include "version.c"
include_directories(${CMAKE_BINARY_DIR})

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/daccess/daccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5793,7 +5793,7 @@ ClrDataAccess::RawGetMethodName(
SIZE_T maxPrecodeSize = sizeof(StubPrecode);

#ifdef HAS_THISPTR_RETBUF_PRECODE
maxPrecodeSize = max(maxPrecodeSize, sizeof(ThisPtrRetBufPrecode));
maxPrecodeSize = max((size_t)maxPrecodeSize, sizeof(ThisPtrRetBufPrecode));
#endif

for (SIZE_T i = 0; i < maxPrecodeSize / PRECODE_ALIGNMENT; i++)
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/debug/dbgutil/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ if(CLR_CMAKE_HOST_WIN32 OR CLR_CMAKE_HOST_OSX)
include_directories(${CLR_DIR}/inc/llvm)
endif(CLR_CMAKE_HOST_WIN32 OR CLR_CMAKE_HOST_OSX)

add_definitions(-DPAL_STDCPP_COMPAT)

if(CLR_CMAKE_TARGET_LINUX_MUSL)
add_definitions(-DTARGET_LINUX_MUSL)
endif(CLR_CMAKE_TARGET_LINUX_MUSL)
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/debug/debug-pal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ include_directories(../inc)
include_directories(../../pal/inc)
include_directories(${EP_GENERATED_HEADER_PATH})

add_definitions(-DPAL_STDCPP_COMPAT)

set(SHARED_EVENTPIPE_SOURCE_PATH ${CLR_SRC_NATIVE_DIR}/eventpipe)
add_definitions(-DFEATURE_CORECLR)
add_definitions(-DFEATURE_PERFTRACING)
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/debug/di/rspriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -3975,9 +3975,9 @@ class CordbProcess :

// CORDB_ADDRESS's are UINT_PTR's (64 bit under HOST_64BIT, 32 bit otherwise)
#if defined(TARGET_64BIT)
#define MAX_ADDRESS (_UI64_MAX)
#define MAX_ADDRESS (UINT64_MAX)
#else
#define MAX_ADDRESS (_UI32_MAX)
#define MAX_ADDRESS (UINT32_MAX)
#endif
#define MIN_ADDRESS (0x0)
CORDB_ADDRESS m_minPatchAddr; //smallest patch in table
Expand Down
10 changes: 5 additions & 5 deletions src/coreclr/debug/di/rsthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5122,7 +5122,7 @@ HRESULT CordbValueEnum::Next(ULONG celt, ICorDebugValue *values[], ULONG *pceltF

HRESULT hr = S_OK;

int iMax = min( m_iMax, m_iCurrent+celt);
int iMax = (int)min( (ULONG)m_iMax, m_iCurrent+celt);
int i;
for (i = m_iCurrent; i< iMax;i++)
{
Expand Down Expand Up @@ -8186,7 +8186,7 @@ HRESULT CordbJITILFrame::FabricateNativeInfo(DWORD dwIndex,
// first argument, but thereafter we have to decrement it
// before getting the variable's location from it. So increment
// it here to be consistent later.
rpCur += max(cbType, cbArchitectureMin);
rpCur += max((ULONG)cbType, cbArchitectureMin);
#endif

// Grab the IL code's function's method signature so we can see if it's static.
Expand Down Expand Up @@ -8219,7 +8219,7 @@ HRESULT CordbJITILFrame::FabricateNativeInfo(DWORD dwIndex,
IfFailThrow(pArgType->GetUnboxedObjectSize(&cbType));

#if defined(TARGET_X86) // STACK_GROWS_DOWN_ON_ARGS_WALK
rpCur -= max(cbType, cbArchitectureMin);
rpCur -= max((ULONG)cbType, cbArchitectureMin);
m_rgNVI[i].loc.vlFixedVarArg.vlfvOffset =
(unsigned)(m_FirstArgAddr - rpCur);

Expand All @@ -8229,7 +8229,7 @@ HRESULT CordbJITILFrame::FabricateNativeInfo(DWORD dwIndex,
#else // STACK_GROWS_UP_ON_ARGS_WALK
m_rgNVI[i].loc.vlFixedVarArg.vlfvOffset =
(unsigned)(rpCur - m_FirstArgAddr);
rpCur += max(cbType, cbArchitectureMin);
rpCur += max((ULONG)cbType, cbArchitectureMin);
AlignAddressForType(pArgType, rpCur);
#endif

Expand Down Expand Up @@ -10877,7 +10877,7 @@ HRESULT CordbCodeEnum::Next(ULONG celt, ICorDebugCode *values[], ULONG *pceltFet

HRESULT hr = S_OK;

int iMax = min( m_iMax, m_iCurrent+celt);
int iMax = (int)min( (ULONG)m_iMax, m_iCurrent+celt);
int i;

for (i = m_iCurrent; i < iMax; i++)
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/di/rstype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2898,7 +2898,7 @@ HRESULT CordbTypeEnum::Next(ULONG celt, ICorDebugType *values[], ULONG *pceltFet

HRESULT hr = S_OK;

int iMax = min( m_iMax, m_iCurrent+celt);
int iMax = (int)min( (ULONG)m_iMax, m_iCurrent+celt);
int i;

for (i = m_iCurrent; i < iMax; i++)
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/di/shimcallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ HRESULT ShimProxyCallback::DataBreakpoint(ICorDebugProcess* pProcess, ICorDebugT
this->m_pThread.Assign(pThread);

_ASSERTE(contextSize == sizeof(CONTEXT));
this->m_contextSize = min(contextSize, sizeof(CONTEXT));
this->m_contextSize = min(contextSize, (ULONG32)sizeof(CONTEXT));
memcpy(&(this->m_context), pContext, this->m_contextSize);
}

Expand Down
3 changes: 3 additions & 0 deletions src/coreclr/debug/di/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
#include <stdio.h>
#include <windows.h>
#include <winnt.h>
#include <algorithm>
using std::min;
using std::max;

#include <dbgtargetcontext.h>

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/ee/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3029,7 +3029,7 @@ HRESULT Debugger::GetILToNativeMappingIntoArrays(
if (pDJI == NULL)
return E_FAIL;

ULONG32 cMap = min(cMapMax, pDJI->GetSequenceMapCount());
ULONG32 cMap = min((ULONG32)cMapMax, pDJI->GetSequenceMapCount());
DebuggerILToNativeMap * rgMapInt = pDJI->GetSequenceMap();

NewArrayHolder<UINT> rguiILOffsetTemp = new (nothrow) UINT[cMap];
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/ee/funceval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2806,7 +2806,7 @@ void PackArgumentArray(DebuggerEval *pDE,

#ifdef FEATURE_HFA
// The buffer for HFAs has to be always ENREGISTERED_RETURNTYPE_MAXSIZE
size = max(size, ENREGISTERED_RETURNTYPE_MAXSIZE);
size = max(size, (unsigned)ENREGISTERED_RETURNTYPE_MAXSIZE);
#endif

BYTE * pTemp = new (interopsafe) BYTE[ALIGN_UP(sizeof(ValueClassInfo), 8) + size];
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/debug/ee/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include <stdint.h>
#include <wchar.h>
#include <stdio.h>
#include <algorithm>
#include <cmath>

#include <windows.h>

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/inc/dbgipcevents.h
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ class MSLAYOUT VMPTR_Base
//
// Operators to emulate Pointer semantics.
//
bool IsNull() { SUPPORTS_DAC; return m_addr == NULL; }
bool IsNull() { SUPPORTS_DAC; return m_addr == (TADDR)0; }

static VMPTR_This NullPtr()
{
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/shared/dbgtransportsession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1949,7 +1949,7 @@ void DbgTransportSession::TransportWorker()
DWORD cbBytesToRead = sReceiveHeader.TypeSpecificData.MemoryAccess.m_cbLeftSideBuffer;
while (cbBytesToRead)
{
DWORD cbTransfer = min(cbBytesToRead, sizeof(rgDummy));
DWORD cbTransfer = min(cbBytesToRead, (DWORD)sizeof(rgDummy));
if (!ReceiveBlock(rgDummy, cbTransfer))
HANDLE_TRANSIENT_ERROR();
cbBytesToRead -= cbTransfer;
Expand Down
8 changes: 0 additions & 8 deletions src/coreclr/dlls/mscordac/mscordac_unixexports.src
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,10 @@ nativeStringResourceTable_mscorrc
; All the # exports are prefixed with DAC_
#PAL_CatchHardwareExceptionHolderEnter
#PAL_CatchHardwareExceptionHolderExit
#PAL_bsearch
#PAL_CopyModuleData
#PAL_errno
#PAL_free
#PAL_GetLogicalCpuCountFromOS
#PAL_GetTotalCpuCount
#PAL_GetUnwindInfoSize
#PAL_stdout
#PAL_stderr
#PAL_GetApplicationGroupId
#PAL_GetTransportName
#PAL_GetCurrentThread
Expand All @@ -47,9 +42,6 @@ nativeStringResourceTable_mscorrc
#PAL_ReadProcessMemory
#PAL_ProbeMemory
#PAL_Random
#PAL_malloc
#PAL_realloc
#PAL_qsort
#PAL__wcstoui64
#PAL_wcstoul
#PAL_wcstod
Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/dlls/mscorpe/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <assert.h>
#include <stdio.h>
#include <stddef.h>
#include <algorithm>

#define FEATURE_NO_HOST // Do not use host interface
#include <utilcode.h>
Expand All @@ -21,3 +22,6 @@
#include "ceegen.h"
#include "ceefilegenwriter.h"
#include "ceesectionstring.h"

using std::min;
using std::max;
3 changes: 3 additions & 0 deletions src/coreclr/gc/env/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#include <math.h>

#include <new>
#include <type_traits>
#include <limits>
#include <algorithm>

#ifdef TARGET_UNIX
#include <pthread.h>
Expand Down
9 changes: 0 additions & 9 deletions src/coreclr/gc/env/gcenv.base.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,6 @@ inline HRESULT HRESULT_FROM_WIN32(unsigned long x)

#define ZeroMemory(Destination,Length) memset((Destination),0,(Length))

#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif

#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif

#define C_ASSERT(cond) static_assert( cond, #cond )

#define UNREFERENCED_PARAMETER(P) (void)(P)
Expand Down Expand Up @@ -393,7 +385,6 @@ typedef struct _PROCESSOR_NUMBER {
uint8_t Number;
uint8_t Reserved;
} PROCESSOR_NUMBER, *PPROCESSOR_NUMBER;

#endif // _INC_WINDOWS

// -----------------------------------------------------------------------------------------------------------
Expand Down
Loading
Loading