Skip to content

Commit

Permalink
Remove support for gcc < 4
Browse files Browse the repository at this point in the history
We probably could drop support for some gcc 4.x versions too, but we
definitely don't need to support gcc 3.x any longer and not doing it
simplifies the code a bit, so just assume gcc >= 4.

Closes #1943
  • Loading branch information
vadz committed Jul 11, 2020
1 parent 39ac04b commit 617db49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 29 deletions.
19 changes: 7 additions & 12 deletions include/wx/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,9 @@ typedef short int WXTYPE;

#ifndef HAVE_WOSTREAM
/*
Mingw <= 3.4 and all versions of Cygwin don't have std::wostream
Cygwin is the only platform which doesn't have std::wostream
*/
#if (!defined(__MINGW32__) || wxCHECK_GCC_VERSION(4, 0)) && \
!defined(__CYGWIN__)
#if !defined(__CYGWIN__)
#define HAVE_WOSTREAM
#endif
#endif /* HAVE_WOSTREAM */
Expand Down Expand Up @@ -622,15 +621,11 @@ typedef short int WXTYPE;
*/
#define wxDEPRECATED(x) wxDEPRECATED_DECL x

#if defined(__GNUC__) && !wxCHECK_GCC_VERSION(3, 4)
/*
We need to add dummy "inline" to allow gcc < 3.4 to handle the
deprecation attribute on the constructors.
*/
#define wxDEPRECATED_CONSTRUCTOR(x) wxDEPRECATED( inline x)
#else
#define wxDEPRECATED_CONSTRUCTOR(x) wxDEPRECATED(x)
#endif
/*
This macro used to be defined differently for gcc < 3.4, but we don't
support it any more, so it's just the same thing as wxDEPRECATED now.
*/
#define wxDEPRECATED_CONSTRUCTOR(x) wxDEPRECATED(x)

/*
Macro which marks the function as being deprecated but also defines it
Expand Down
17 changes: 0 additions & 17 deletions include/wx/wxcrt.h
Original file line number Diff line number Diff line change
Expand Up @@ -460,20 +460,9 @@ WX_STRCMP_FUNC(wxStricmp, wxCRT_StricmpA, wxCRT_StricmpW, wxStricmp_String)

#if defined(wxCRT_StrcollA) && defined(wxCRT_StrcollW)

// GCC 3.4 and other compilers have a bug that causes it to fail compilation if
// the template's implementation uses overloaded function declared later (see
// the wxStrcoll() call in wxStrcoll_String<T>()), so we have to
// forward-declare the template and implement it below WX_STRCMP_FUNC. OTOH,
// this causes problems with GCC visibility in newer GCC versions.
#if !(wxCHECK_GCC_VERSION(3,5) && !wxCHECK_GCC_VERSION(4,7)) || defined(__clang__)
#define wxNEEDS_DECL_BEFORE_TEMPLATE
#endif

#ifdef wxNEEDS_DECL_BEFORE_TEMPLATE
template<typename T>
inline int wxStrcoll_String(const wxString& s1, const T& s2);
WX_STRCMP_FUNC(wxStrcoll, wxCRT_StrcollA, wxCRT_StrcollW, wxStrcoll_String)
#endif // wxNEEDS_DECL_BEFORE_TEMPLATE

template<typename T>
inline int wxStrcoll_String(const wxString& s1, const T& s2)
Expand All @@ -489,12 +478,6 @@ inline int wxStrcoll_String(const wxString& s1, const T& s2)
#endif
}

#ifndef wxNEEDS_DECL_BEFORE_TEMPLATE
// this is exactly the same WX_STRCMP_FUNC line as above, inside the
// wxNEEDS_DECL_BEFORE_TEMPLATE case
WX_STRCMP_FUNC(wxStrcoll, wxCRT_StrcollA, wxCRT_StrcollW, wxStrcoll_String)
#endif

#endif // defined(wxCRT_Strcoll[AW])

template<typename T>
Expand Down

2 comments on commit 617db49

@PBfordev
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vadz

README.md in the root folder states that g++ 3.4 or later is supported. I suppose that those minimal requirements listed there (OS, compiler...) are for the stable and not the development branch?

Additionally, the readme states

macOS (10.10 or newer) using Cocoa under both amd64 and ARM platforms.

while http://wxwidgets.org/about/ has in the supported platforms

wxOSX/Cocoa: For delivering 32-bit and 64-bit Cocoa-based applications on macOS 10.7 and above.

@vadz
Copy link
Contributor Author

@vadz vadz commented on 617db49 Jul 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README.md is version-controlled, so it's per branch and the version in master shouldn't claim gcc 3.4 support as it probably doesn't work any more (although it still might...), I'll fix this, thanks.

But the web site doesn't have branches, so the information there is indeed for the stable branch and we'll just need to remember to update it before releasing 3.2, I've created a ticket for this.

Please sign in to comment.