diff --git a/src/coreclr/debug/createdump/createdump.h b/src/coreclr/debug/createdump/createdump.h index 50cf53dccfc7aa..4095a5693794af 100644 --- a/src/coreclr/debug/createdump/createdump.h +++ b/src/coreclr/debug/createdump/createdump.h @@ -33,8 +33,6 @@ extern void trace_verbose_printf(const char* format, ...); #endif #include -#include -#include #include #include #include @@ -84,6 +82,7 @@ typedef int T_CONTEXT; #define __STDC_FORMAT_MACROS #include #else +#include #include #endif #include diff --git a/src/coreclr/debug/daccess/stdafx.h b/src/coreclr/debug/daccess/stdafx.h index 050b4eac513724..bb7b7b2365de59 100644 --- a/src/coreclr/debug/daccess/stdafx.h +++ b/src/coreclr/debug/daccess/stdafx.h @@ -26,7 +26,9 @@ #include +#ifdef HOST_WINDOWS #include +#endif #include #include diff --git a/src/coreclr/ildasm/ildasmpch.h b/src/coreclr/ildasm/ildasmpch.h index b422a059b0eb96..9d89ba46db52c2 100644 --- a/src/coreclr/ildasm/ildasmpch.h +++ b/src/coreclr/ildasm/ildasmpch.h @@ -12,7 +12,6 @@ #include #include #include -#include #ifndef Debug_ReportError #define Debug_ReportError(strMessage) diff --git a/src/coreclr/inc/clr/stack.h b/src/coreclr/inc/clr/stack.h deleted file mode 100644 index 97719c21c9ebed..00000000000000 --- a/src/coreclr/inc/clr/stack.h +++ /dev/null @@ -1,98 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// This header provides a basic stack implementation - -#ifndef _clr_Stack_h_ -#define _clr_Stack_h_ - -namespace clr -{ - //------------------------------------------------------------------------------------------------- - // A basic stack class. - // - template < typename T > - class Stack - { - private: - //--------------------------------------------------------------------------------------------- - struct Link - { - template < typename A1 > - Link(A1 && a1, Link * next = nullptr) - : _value(std::forward(a1)) - , _next(next) - {} - - T _value; - Link * _next; - }; - - public: - //--------------------------------------------------------------------------------------------- - // Empty stack constructor. - Stack() - : _top(nullptr) - , _size(0) - {} - - //--------------------------------------------------------------------------------------------- - // Move constructor. - Stack(Stack && stack) - : _top(nullptr) - , _size(0) - { *this = std::move(stack); } - - //--------------------------------------------------------------------------------------------- - ~Stack() - { - while (!empty()) - { - pop(); - } - } - - //--------------------------------------------------------------------------------------------- - // Move assignment. - Stack& operator=(Stack && stack) - { std::swap(_top, stack._top); std::swap(_size, stack._size); } - - //--------------------------------------------------------------------------------------------- - bool empty() const - { return _top == nullptr; } - - //--------------------------------------------------------------------------------------------- - size_t size() const - { return _size; } - - //--------------------------------------------------------------------------------------------- - T & top() - { return _top->_value; } - - //--------------------------------------------------------------------------------------------- - T const & top() const - { return _top->_value; } - - //--------------------------------------------------------------------------------------------- - template < typename A1 > inline - void push(A1 && value) - { - STATIC_CONTRACT_THROWS; - _top = new Link(std::forward(value), _top); - ++_size; - } - - //--------------------------------------------------------------------------------------------- - void pop() - { Link * del = _top; _top = _top->_next; --_size; delete del; } - - private: - //--------------------------------------------------------------------------------------------- - Link * _top; - size_t _size; - }; -} // namespace clr - -#endif // _clr_Stack_h_ diff --git a/src/coreclr/inc/clr/win32.h b/src/coreclr/inc/clr/win32.h deleted file mode 100644 index 0198a732da8ce1..00000000000000 --- a/src/coreclr/inc/clr/win32.h +++ /dev/null @@ -1,37 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// -// clr/win32.h -// -// Provides Win32-specific utility functionality. -// - -// - -#ifndef clr_win32_h -#define clr_win32_h - -#include "winwrap.h" - -namespace clr -{ - namespace win32 - { - // Prevents an HMODULE from being unloaded until process termination. - inline - HRESULT PreventModuleUnload(HMODULE hMod) - { - if (!WszGetModuleHandleEx( - GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_PIN, - reinterpret_cast(hMod), - &hMod)) - { - return HRESULT_FROM_GetLastError(); - } - - return S_OK; - } - } // namespace win -} // namespace clr - -#endif // clr_win32_h diff --git a/src/coreclr/pal/inc/rt/conio.h b/src/coreclr/pal/inc/rt/conio.h deleted file mode 100644 index 9dd9c0a06d2968..00000000000000 --- a/src/coreclr/pal/inc/rt/conio.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: conio.h -// -// =========================================================================== -// dummy conio.h for PAL - -#include "palrt.h" diff --git a/src/coreclr/pal/inc/rt/cpp/io.h b/src/coreclr/pal/inc/rt/cpp/io.h deleted file mode 100644 index 64f3a52df7307b..00000000000000 --- a/src/coreclr/pal/inc/rt/cpp/io.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: io.h -// -// =========================================================================== -// dummy io.h for PAL - -#include "palrt.h" diff --git a/src/coreclr/pal/inc/rt/dbghelp.h b/src/coreclr/pal/inc/rt/dbghelp.h deleted file mode 100644 index 1d231d34fc3989..00000000000000 --- a/src/coreclr/pal/inc/rt/dbghelp.h +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ BUILD Version: 0000 Increment this if a change has global effects - - - -Module Name: - - dbghelp.h - -Abstract: - - This module defines the prototypes and constants required for the image - help routines. - - Contains debugging support routines that are redistributable. - -Revision History: - ---*/ - -#ifndef _DBGHELP_ -#define _DBGHELP_ - -#if _MSC_VER > 1020 -#pragma once -#endif - -// -// options that are set/returned by SymSetOptions() & SymGetOptions() -// these are used as a mask -// -#define SYMOPT_LOAD_LINES 0x00000010 - -#endif // _DBGHELP_ diff --git a/src/coreclr/pal/inc/rt/palrt.h b/src/coreclr/pal/inc/rt/palrt.h index fffc116766f9c0..1e52727ccdba95 100644 --- a/src/coreclr/pal/inc/rt/palrt.h +++ b/src/coreclr/pal/inc/rt/palrt.h @@ -630,10 +630,6 @@ typedef unsigned int ALG_ID; // 1 null termination #define LOCALE_NAME_MAX_LENGTH 85 -#define CSTR_LESS_THAN 1 -#define CSTR_EQUAL 2 -#define CSTR_GREATER_THAN 3 - #ifdef __cplusplus /* @@ -736,22 +732,13 @@ typename std::remove_reference::type&& move( T&& t ); typedef DWORD OLE_COLOR; -#define PF_COMPARE_EXCHANGE_DOUBLE 2 - -typedef VOID (NTAPI * WAITORTIMERCALLBACKFUNC) (PVOID, BOOLEAN ); - typedef HANDLE HWND; -#define IS_TEXT_UNICODE_SIGNATURE 0x0008 -#define IS_TEXT_UNICODE_UNICODE_MASK 0x000F - typedef struct _LIST_ENTRY { struct _LIST_ENTRY *Flink; struct _LIST_ENTRY *Blink; } LIST_ENTRY, *PLIST_ENTRY; -typedef VOID (NTAPI *WAITORTIMERCALLBACK)(PVOID, BOOLEAN); - // PORTABILITY_ASSERT and PORTABILITY_WARNING macros are meant to be used to // mark places in the code that needs attention for portability. The usual // usage pattern is: @@ -866,11 +853,6 @@ interface ITypeInfo; interface ITypeLib; interface IMoniker; -typedef VOID (WINAPI *LPOVERLAPPED_COMPLETION_ROUTINE)( - DWORD dwErrorCode, - DWORD dwNumberOfBytesTransferred, - LPOVERLAPPED lpOverlapped); - // // Debug APIs // @@ -1108,26 +1090,6 @@ typedef LONG (WINAPI *PTOP_LEVEL_EXCEPTION_FILTER)( ); typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER; -/******************* ntdef ************************************/ - -#ifndef ANYSIZE_ARRAY -#define ANYSIZE_ARRAY 1 // winnt -#endif - -/******************* winnt ************************************/ - -typedef struct LIST_ENTRY32 { - ULONG Flink; - ULONG Blink; -} LIST_ENTRY32; -typedef LIST_ENTRY32 *PLIST_ENTRY32; - -typedef struct LIST_ENTRY64 { - ULONGLONG Flink; - ULONGLONG Blink; -} LIST_ENTRY64; -typedef LIST_ENTRY64 *PLIST_ENTRY64; - /******************** PAL RT APIs *******************************/ typedef struct _HSATELLITE *HSATELLITE; diff --git a/src/coreclr/pal/inc/rt/verrsrc.h b/src/coreclr/pal/inc/rt/verrsrc.h deleted file mode 100644 index 0bd71033246bec..00000000000000 --- a/src/coreclr/pal/inc/rt/verrsrc.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: verrsrc.h -// -// =========================================================================== -// dummy verrsrc.h for PAL - -#include "palrt.h" diff --git a/src/coreclr/pal/inc/rt/winresrc.h b/src/coreclr/pal/inc/rt/winresrc.h index b0843d15f1f2a9..88af2984da3366 100644 --- a/src/coreclr/pal/inc/rt/winresrc.h +++ b/src/coreclr/pal/inc/rt/winresrc.h @@ -10,5 +10,4 @@ // winresrc.h for PAL // Included in .rc files. -#include "winver.h" #include "palrt.h" diff --git a/src/coreclr/pal/inc/rt/winternl.h b/src/coreclr/pal/inc/rt/winternl.h deleted file mode 100644 index a5e42c6678bc28..00000000000000 --- a/src/coreclr/pal/inc/rt/winternl.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: winternl.h -// -// =========================================================================== -// dummy winternl.h for PAL - -#include "palrt.h" diff --git a/src/coreclr/pal/inc/rt/winver.h b/src/coreclr/pal/inc/rt/winver.h deleted file mode 100644 index b0f441e1a1d410..00000000000000 --- a/src/coreclr/pal/inc/rt/winver.h +++ /dev/null @@ -1,29 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: winver.h -// -// =========================================================================== -// winver.h for PAL -// Included in .rc files. - -#define VS_VERSION_INFO 1 -#define VS_FFI_FILEFLAGSMASK 0x0000003FL - -#define VS_FF_DEBUG 0x00000001L -#define VS_FF_PRERELEASE 0x00000002L -#define VS_FF_PATCHED 0x00000004L -#define VS_FF_PRIVATEBUILD 0x00000008L -#define VS_FF_INFOINFERRED 0x00000010L -#define VS_FF_SPECIALBUILD 0x00000020L - -#define VFT_UNKNOWN 0x00000000L -#define VFT_APP 0x00000001L -#define VFT_DLL 0x00000002L - -#define VFT2_UNKNOWN 0x00000000L - -#define VOS__WINDOWS32 0x00000004L diff --git a/src/coreclr/pal/prebuilt/inc/fxver.h b/src/coreclr/pal/prebuilt/inc/fxver.h index 7297587490de46..b88f7e9c9514a1 100644 --- a/src/coreclr/pal/prebuilt/inc/fxver.h +++ b/src/coreclr/pal/prebuilt/inc/fxver.h @@ -1,7 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +// Our custom .rc parser on Unix follows the #ifdef and #include rules +// Use #ifndef here to avoid dummy verrsrc.h +#ifndef HOST_UNIX #include +#endif #define QUOTE_MACRO_HELPER(x) #x #define QUOTE_MACRO(x) QUOTE_MACRO_HELPER(x) diff --git a/src/coreclr/pal/src/file/filetime.cpp b/src/coreclr/pal/src/file/filetime.cpp index ea8ca6bd0535ad..2500d234d8b65a 100644 --- a/src/coreclr/pal/src/file/filetime.cpp +++ b/src/coreclr/pal/src/file/filetime.cpp @@ -188,35 +188,6 @@ GetSystemTimeAsFileTime( } -#ifdef __APPLE__ -/*++ -Function: - FILECFAbsoluteTimeToFileTime - -Convert a CFAbsoluteTime value to a win32 FILETIME structure, as described -in MSDN documentation. CFAbsoluteTime is the number of seconds elapsed since -00:00 01 January 2001 UTC (Mac OS X epoch), while FILETIME represents a -64-bit number of 100-nanosecond intervals that have passed since 00:00 -01 January 1601 UTC (win32 epoch). ---*/ -FILETIME FILECFAbsoluteTimeToFileTime( CFAbsoluteTime sec ) -{ - __int64 Result; - FILETIME Ret; - - Result = ((__int64)sec + SECS_BETWEEN_1601_AND_2001_EPOCHS) * SECS_TO_100NS; - - Ret.dwLowDateTime = (DWORD)Result; - Ret.dwHighDateTime = (DWORD)(Result >> 32); - - TRACE("CFAbsoluteTime = [%9f] converts to Win32 FILETIME = [%#x:%#x]\n", - sec, Ret.dwHighDateTime, Ret.dwLowDateTime); - - return Ret; -} -#endif // __APPLE__ - - /*++ Function: FILEUnixTimeToFileTime diff --git a/src/coreclr/pal/src/include/pal/filetime.h b/src/coreclr/pal/src/include/pal/filetime.h index 5a06cb5c3063e6..cf177058be47cb 100644 --- a/src/coreclr/pal/src/include/pal/filetime.h +++ b/src/coreclr/pal/src/include/pal/filetime.h @@ -63,12 +63,6 @@ extern "C" FILETIME FILEUnixTimeToFileTime( time_t sec, long nsec ); -#ifdef __APPLE__ -#include - -FILETIME FILECFAbsoluteTimeToFileTime( CFAbsoluteTime sec ); -#endif // __APPLE__ - #ifdef __cplusplus } #endif // __cplusplus diff --git a/src/coreclr/vm/dwreport.cpp b/src/coreclr/vm/dwreport.cpp index 875936fed09a42..83e42a27d18e17 100644 --- a/src/coreclr/vm/dwreport.cpp +++ b/src/coreclr/vm/dwreport.cpp @@ -18,7 +18,6 @@ #include #include #include "dbginterface.h" -#include #include "dlwrap.h" #include "eventreporter.h" #include "utilcode.h"