Windows follow-up: minimize pragma scope

Avoid disruption to mingw32-x64 build, by placing
some Visual Studio pragmas in #ifdef _MSC_VER
conditional blocks.
This commit is contained in:
nhmall
2023-12-27 15:00:08 -05:00
parent 3eb0fab317
commit e69c98c14a
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -627,10 +627,14 @@ BOOL winos_font_support_cp437(HFONT hFont)
if (size) { if (size) {
GLYPHSET *glyphSet = (GLYPHSET *) malloc((size_t) size); GLYPHSET *glyphSet = (GLYPHSET *) malloc((size_t) size);
if (glyphSet != NULL) { if (glyphSet != NULL) {
#ifdef _MSC_VER
#pragma warning( push ) #pragma warning( push )
#pragma warning( disable : 6386 ) #pragma warning( disable : 6386 )
#endif
size = GetFontUnicodeRanges(hdc, glyphSet); size = GetFontUnicodeRanges(hdc, glyphSet);
#ifdef _MSC_VER
#pragma warning( pop ) #pragma warning( pop )
#endif
allFound = TRUE; allFound = TRUE;
for (int i = 0; i < 256 && allFound; i++) { for (int i = 0; i < 256 && allFound; i++) {
WCHAR wc = cp437[i]; WCHAR wc = cp437[i];
+5
View File
@@ -77,8 +77,11 @@ static void __cdecl mswin_moveloop(void *);
#define MAX_CMDLINE_PARAM 255 #define MAX_CMDLINE_PARAM 255
#ifdef _MSC_VER
#pragma warning( push ) #pragma warning( push )
#pragma warning( disable : 28251) #pragma warning( disable : 28251)
#endif
int APIENTRY int APIENTRY
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
int nCmdShow) int nCmdShow)
@@ -248,7 +251,9 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
return 0; return 0;
} }
#ifdef _MSC_VER
#pragma warning( pop ) #pragma warning( pop )
#endif
PNHWinApp PNHWinApp
GetNHApp(void) GetNHApp(void)