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.

38 changes: 0 additions & 38 deletions src/coreclr/pal/inc/rt/palrt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
/*
Expand Down Expand Up @@ -736,22 +732,13 @@ typename std::remove_reference<T>::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:
Expand Down Expand Up @@ -866,11 +853,6 @@ interface ITypeInfo;
interface ITypeLib;
interface IMoniker;

typedef VOID (WINAPI *LPOVERLAPPED_COMPLETION_ROUTINE)(
DWORD dwErrorCode,
DWORD dwNumberOfBytesTransferred,
LPOVERLAPPED lpOverlapped);

//
// Debug APIs
//
Expand Down Expand Up @@ -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;
Expand Down
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.

4 changes: 4 additions & 0 deletions src/coreclr/pal/prebuilt/inc/fxver.h
Original file line number Diff line number Diff line change
@@ -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, but doesn't inspect actual values of the macros.
// Use #ifndef here to avoid dummy verrsrc.h
#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
Loading