From e13f1288772a23069470562fb5e0ce228640e77c Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Sun, 29 Dec 2002 19:37:10 +0000 Subject: [PATCH] Allow building in unicode mode with just "make -f makefile.g95 UNICODE=1" without requiring setup.h modifications. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18455 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/gccpriv.h | 3 ++- include/wx/msw/setup0.h | 4 +++- src/makeg95.env | 11 +++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/include/wx/msw/gccpriv.h b/include/wx/msw/gccpriv.h index c0e84b250b..41d363014a 100644 --- a/include/wx/msw/gccpriv.h +++ b/include/wx/msw/gccpriv.h @@ -48,7 +48,8 @@ // Mingw runtime 1.0-20010604 has some missing _tXXXX functions, // so let's define them ourselves: -#if defined(__GNUWIN32__) && wxCHECK_W32API_VERSION( 1, 0 ) +#if defined(__GNUWIN32__) && wxCHECK_W32API_VERSION( 1, 0 ) \ + && !wxCHECK_W32API_VERSION( 1, 1 ) #ifndef _tsetlocale #if wxUSE_UNICODE #define _tsetlocale _wsetlocale diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index bb0e917728..92bfe23367 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -168,7 +168,9 @@ // Default is 0 // // Recommended setting: 0 (unless you only plan to use Windows NT/2000/XP) -#define wxUSE_UNICODE 0 +#ifndef wxUSE_UNICODE + #define wxUSE_UNICODE 0 +#endif // Set wxUSE_UNICODE_MSLU to 1 if you want to compile wxWindows in Unicode mode // and be able to run compiled apps under Windows 9x as well as NT/2000/XP. This diff --git a/src/makeg95.env b/src/makeg95.env index 183195b374..45fbe7afb4 100644 --- a/src/makeg95.env +++ b/src/makeg95.env @@ -188,6 +188,13 @@ DLLTOOL = dlltool ########################## Compiler flags ############################# +# Unicode defines +ifeq ($(UNICODE),1) + UNICODE_OPT = -D_UNICODE -DUNICODE -DwxUSE_UNICODE=1 +else + UNICODE_OPT = +endif + # Miscellaneous compiler options OPTIONS = -DSTRICT $(_USE_W32API_HEADER_IF_SUPPORTED) @@ -367,9 +374,9 @@ ALL_CPPFLAGS = $(XINCLUDE) $(INC) $(CPPFLAGS) $(EXTRACPPFLAGS) # C and C++ compiler flags for compatibility with old gcc versions REQUIRED_GCC_FLAGS = $(_STRUCT_RETURN_WORKAROUND) $(_THUNK_WORKAROUND) # C++ compiler flags -ALL_CXXFLAGS = $(COMMON_THREADFLAGS) $(REQUIRED_GCC_FLAGS) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT) $(EXTRADLLFLAGS) $(CXXFLAGS) +ALL_CXXFLAGS = $(COMMON_THREADFLAGS) $(REQUIRED_GCC_FLAGS) $(UNICODE_OPT) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT) $(EXTRADLLFLAGS) $(CXXFLAGS) # C compiler flags -ALL_CFLAGS = $(COMMON_THREADFLAGS) $(REQUIRED_GCC_FLAGS) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT) $(EXTRADLLFLAGS) $(CFLAGS) +ALL_CFLAGS = $(COMMON_THREADFLAGS) $(REQUIRED_GCC_FLAGS) $(UNICODE_OPT) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT) $(EXTRADLLFLAGS) $(CFLAGS) # Linker flags ALL_LDFLAGS = $(COMMON_THREADFLAGS) $(WINDOWSLDFLAGS) $(WINDOWSLDLIBS) $(WXLIBDIRS) $(EXTRALDFLAGS) $(LDFLAGS) # under Cygwin, Dlls must not be linked with subsystem=windows -- 2.45.2