8000 Minor changes to DataTypes: ignore some MS warnings and move ResID2In… · coderforlife/pe-file@098df35 · GitHub
[go: up one dir, main page]

Skip to content

Commit 098df35

Browse files
committed
Minor changes to DataTypes: ignore some MS warnings and move ResID2Int out of internal namespace.
1 parent 4a70e28 commit 098df35

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

PEDataTypes.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
#define _CRT_SECURE_NO_WARNINGS
2323

24+
#ifdef _MSC_VER
25+
#pragma warning(disable : 4201 4480) // nonstandard extension used: [nameless struct/union | specifying underlying type for enum]
26+
#endif
27+
2428
#ifdef _WIN32
2529
#define USE_WINDOWS_API
2630
#elif !defined(__posix)
@@ -57,6 +61,7 @@ namespace PE {
5761

5862
inline static bool IsIntResID(const_resid r) { return (((size_t)r) >> 16) == 0; }
5963
inline static resid MakeResID(uint16_t i) { return (resid)(size_t)i; }
64+
inline static uint16_t ResID2Int(const_resid r) { return (uint16_t)(size_t)r; }
6065

6166
static const void*const null = NULL;
6267

@@ -241,7 +246,6 @@ namespace PE {
241246
};
242247

243248
namespace Internal {
244-
inline static uint16_t ResID2Int(const_resid r) { return (uint16_t)(size_t)r; }
245249
#ifndef ARRAYSIZE
246250
#define ARRAYSIZE(a) sizeof(a)/sizeof(a[0])
247251
#endif

0 commit comments

Comments
 (0)
0