From 73a6f54d7cb27d51c24f23d59456e58d857c147b Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Wed, 12 Jul 2023 10:02:01 +1000 Subject: [PATCH] apparently there is a macro I'll squash this back into the win32: detect ucrt versions of gcc and allow building with it once it passes CI --- win32/GNUmakefile | 17 +---------------- win32/Makefile | 1 - win32/win32.h | 4 ++-- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/win32/GNUmakefile b/win32/GNUmakefile index 43aa11efb765..966d23020b29 100644 --- a/win32/GNUmakefile +++ b/win32/GNUmakefile @@ -487,15 +487,6 @@ GCCVER2 := $(shell for /f "delims=. tokens=1,2,3" %%i in ('$(GCCBIN) -dumpversi GCCVER3 := $(shell for /f "delims=. tokens=1,2,3" %%i in ('$(GCCBIN) -dumpversion') do echo %%k) endif -# are we using UCRT or MSVCRT? -ifeq ($(CCTYPE),GCC) -CRT_TYPE := $(shell gcc --version 2>&1 | find "msvcrt" >nul && ( echo msvcrt) || ( echo ucrt) ) -else ifeq ($(CCTYPE),MSVC120) -CRT_TYPE := msvcrt -else -CRT_TYPE := ucrt -endif - # Set the install location of the compiler headers/libraries. # These are saved into $Config{incpath} and $Config{libpth}. ifneq ($(GCCCROSS),) @@ -786,11 +777,6 @@ TESTPREPGCC = endif -ifeq ($(CRT_TYPE),ucrt) -BUILDOPT += -DPERL_WIN32_UCRT -MINIBUILDOPT += -DPERL_WIN32_UCRT -endif - CFLAGS_O = $(CFLAGS) $(BUILDOPT) RSC_FLAGS = @@ -1164,8 +1150,7 @@ ifeq ($(CCTYPE),GCC) echo # WIN64=$(WIN64)&& \ echo # ARCHITECTURE=$(ARCHITECTURE)&& \ echo # ARCHNAME=$(ARCHNAME)&& \ - echo # MAKE=$(PLMAKE) && \ - echo # CRT_TYPE=$(CRT_TYPE) + echo # MAKE=$(PLMAKE) else @echo # CCTYPE=$(CCTYPE)&& \ echo # WIN64=$(WIN64)&& \ diff --git a/win32/Makefile b/win32/Makefile index 96d38cef359c..c96c5c780049 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -442,7 +442,6 @@ EXTRACFLAGS = -nologo -GF -W3 LIBC = msvcrt.lib !ELSE LIBC = ucrt.lib -DEFINES = $(DEFINES) -DPERL_WIN32_UCRT !ENDIF !IF "$(CFG)" == "Debug" diff --git a/win32/win32.h b/win32/win32.h index 9139ea98d9d0..193990e9bb27 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -262,7 +262,7 @@ extern const __declspec(selectany) union PerlNan __PL_nan_u = { 0x7FF80000000000 #endif /* ifdef _MSC_VER */ /* The CRT was rewritten in VS2015. */ -#ifdef PERL_WIN32_UCRT +#ifdef _UCRT /* No longer declared in stdio.h */ EXTERN_C char *gets(char* buffer); @@ -297,7 +297,7 @@ typedef struct #define PERLIO_FILE_flag(f) ((int)(((__crt_stdio_stream_data*)(f))->_flags)) #define PERLIO_FILE_file(f) (*(int*)(&((__crt_stdio_stream_data*)(f))->_file)) -#else /* ifdef PERL_WIN32_UCRT */ +#else /* ifdef _UCRT */ /* Note: PERLIO_FILE_ptr/base/cnt are not actually used for GCC or