# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1672997639 0 # Node ID afe9c20294cadbb7a583531eb3f5fa3d72248169 # Parent f99414164f5bcf5a87944a3d14be3e1953899b03 Win: Fix building dwtestoo with MinGW32/64. Need to use __cdecl in C++ mode. Also GCC 12 pukes on lambdas with stdio functions without #include GCC 8 compiled it fine without the include. diff -r f99414164f5b -r afe9c20294ca dw.h --- a/dw.h Fri Jan 06 07:58:49 2023 +0000 +++ b/dw.h Fri Jan 06 09:33:59 2023 +0000 @@ -599,11 +599,11 @@ #if defined(MSVC) && !defined(API) # if defined(__MINGW32__) && defined(BUILD_DLL) -# define API _cdecl __declspec(dllexport) +# define API __cdecl __declspec(dllexport) # else -# define API _cdecl +# define API __cdecl #endif -#define DWSIGNAL _cdecl +#define DWSIGNAL __cdecl #endif #define DW_DT_LEFT SS_LEFTNOWORDWRAP diff -r f99414164f5b -r afe9c20294ca dwtestoo.cpp --- a/dwtestoo.cpp Fri Jan 06 07:58:49 2023 +0000 +++ b/dwtestoo.cpp Fri Jan 06 09:33:59 2023 +0000 @@ -2,6 +2,7 @@ // ground for Dynamic Windows features in C++. // By: Brian Smith and Mark Hessling #include "dw.hpp" +#include // Select a fixed width font for our platform #ifdef __OS2__ diff -r f99414164f5b -r afe9c20294ca makefile.mingw --- a/makefile.mingw Fri Jan 06 07:58:49 2023 +0000 +++ b/makefile.mingw Fri Jan 06 09:33:59 2023 +0000 @@ -1,8 +1,9 @@ # Dynamic Windows MINGW Makefile -CC = gcc -RM = del /f +CC = gcc +CXX = g++ +RM = rm -f DEFS = LIBS = @@ -32,7 +33,7 @@ VPATH=../ ../win -all: dw.dll dwcompat.dll dwtest.exe +all: dw.dll dwcompat.dll dwtest.exe dwtestoo.exe dw.res: win/dw.rc windres --target=$(PLATFORM_TARGET) --input win/dw.rc --output dw.res --output-format=coff @@ -47,10 +48,13 @@ dwtest.res: win/dwtest.rc windres --target=$(PLATFORM_TARGET) --input win/dwtest.rc --output dwtest.res --output-format=coff - + dwtest.exe: dwtest.o dw.a dwcompat.a dwtest.res $(CC) $(CFLAGS) -o dwtest.exe dwtest.res dwtest.o dw.a dwcompat.a +dwtestoo.exe: dwtestoo.o dw.a dwcompat.a dwtest.res + $(CXX) $(CFLAGS) -o dwtestoo.exe dwtest.res dwtestoo.o dw.a dwcompat.a + clean: $(RM) *.obj *.o *.lib *.res *~ dwtest.exe dw.dll dwcompat.dll SVN.REV @@ -72,6 +76,9 @@ dwtest.o: dwtest.c $(CC) $(CFLAGS) -c $< +dwtestoo.o: dwtestoo.cpp + $(CXX) -std=c++11 $(CFLAGS) -c $< + DEPS := $(wildcard *.d) ifneq ($(DEPS),) include $(DEPS)