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 some unused headers and functions #91177

Merged
merged 16 commits into from
Sep 1, 2023
3 changes: 1 addition & 2 deletions src/coreclr/debug/createdump/createdump.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ extern void trace_verbose_printf(const char* format, ...);
#endif

#include <windows.h>
#include <winternl.h>
#include <winver.h>
#include <stdlib.h>
#include <stdint.h>
#include <stddef.h>
Expand Down Expand Up @@ -84,6 +82,7 @@ typedef int T_CONTEXT;
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#else
#include <winternl.h>
#include <dbghelp.h>
#endif
#include <map>
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/debug/daccess/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@

#include <winwrap.h>

#ifdef HOST_WINDOWS
#include <dbghelp.h>
#endif

#include <wchar.h>
#include <stdio.h>
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/ildasm/ildasmpch.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <conio.h>

#ifndef Debug_ReportError
#define Debug_ReportError(strMessage)
Expand Down
98 changes: 0 additions & 98 deletions src/coreclr/inc/clr/stack.h

This file was deleted.

37 changes: 0 additions & 37 deletions src/coreclr/inc/clr/win32.h

This file was deleted.

12 changes: 0 additions & 12 deletions src/coreclr/pal/inc/rt/conio.h

This file was deleted.

12 changes: 0 additions & 12 deletions src/coreclr/pal/inc/rt/cpp/io.h

This file was deleted.

36 changes: 0 additions & 36 deletions src/coreclr/pal/inc/rt/dbghelp.h

This file was deleted.

12 changes: 0 additions & 12 deletions src/coreclr/pal/inc/rt/verrsrc.h

This file was deleted.

1 change: 0 additions & 1 deletion src/coreclr/pal/inc/rt/winresrc.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@
// winresrc.h for PAL
// Included in .rc files.

#include "winver.h"
#include "palrt.h"
12 changes: 0 additions & 12 deletions src/coreclr/pal/inc/rt/winternl.h

This file was deleted.

29 changes: 0 additions & 29 deletions src/coreclr/pal/inc/rt/winver.h

This file was deleted.

2 changes: 2 additions & 0 deletions src/coreclr/pal/prebuilt/inc/fxver.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#ifndef HOST_UNIX
#include <verrsrc.h>
#endif
Comment on lines +6 to +8
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 custom .rc parser on Unix seems honoring #include rule, but does not looks into the actual content of macros. Do we need a comment for it?

Copy link
Member

Choose a reason for hiding this comment

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

If this ifdef is tricky, a comment would be useful.

Copy link
Member

Choose a reason for hiding this comment

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

I am not sure I understand what you mean by "doesn't inspect the actual values of the macros". The parser first runs the resource file through the C preprocessor, so it should process all macros should be expanded to their values during that phase.

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't look depth about how the parser works and how it works, but it seems that palrt.h doesn't bring any macro used. I'll update the comment.


#define QUOTE_MACRO_HELPER(x) #x
#define QUOTE_MACRO(x) QUOTE_MACRO_HELPER(x)
Expand Down
29 changes: 0 additions & 29 deletions src/coreclr/pal/src/file/filetime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions src/coreclr/pal/src/include/pal/filetime.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ extern "C"

FILETIME FILEUnixTimeToFileTime( time_t sec, long nsec );

#ifdef __APPLE__
#include <CoreFoundation/CFDate.h>

FILETIME FILECFAbsoluteTimeToFileTime( CFAbsoluteTime sec );
#endif // __APPLE__

#ifdef __cplusplus
}
#endif // __cplusplus
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/vm/dwreport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <msodwwrap.h>
#include <werapi.h>
#include "dbginterface.h"
#include <winver.h>
#include "dlwrap.h"
#include "eventreporter.h"
#include "utilcode.h"
Expand Down