From 1e6251d59298d00a828e5b723bee9f5e341f9f50 Mon Sep 17 00:00:00 2001 From: ARATA Mizuki Date: Tue, 30 Aug 2016 18:07:32 +0900 Subject: [PATCH 1/4] Replace wx_static_cast/wx_const_cast/wx_reinterpret_cast with the function-style casts See #17655. --- docs/doxygen/overviews/refcount.h | 2 +- include/wx/defs.h | 6 ++--- include/wx/dlist.h | 2 +- interface/wx/object.h | 37 ++----------------------------- interface/wx/pickerbase.h | 2 +- samples/xti/classlist.cpp | 4 ++-- src/unix/glx11.cpp | 2 +- 7 files changed, 11 insertions(+), 44 deletions(-) diff --git a/docs/doxygen/overviews/refcount.h b/docs/doxygen/overviews/refcount.h index 433b56e298..bfa2dd9a27 100644 --- a/docs/doxygen/overviews/refcount.h +++ b/docs/doxygen/overviews/refcount.h @@ -108,7 +108,7 @@ class-specific shared data. For example: @code MyClassRefData* GetData() const { - return wx_static_cast(MyClassRefData*, m_refData); + return static_cast(m_refData); } @endcode diff --git a/include/wx/defs.h b/include/wx/defs.h index 84793c02b9..fe5fdb48f7 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -337,7 +337,7 @@ typedef short int WXTYPE; #endif /* for consistency with wxStatic/DynamicCast defined in wx/object.h */ -#define wxConstCast(obj, className) wx_const_cast(className *, obj) +#define wxConstCast(obj, className) const_cast(obj) #ifndef HAVE_STD_WSTRING #if __cplusplus >= 201103L @@ -1284,7 +1284,7 @@ inline wxUIntPtr wxPtrToUInt(const void *p) #pragma warning(disable: 1684) #endif - return wx_reinterpret_cast(wxUIntPtr, p); + return reinterpret_cast(p); #if defined(__VISUALC__) || defined(__INTELC__) #pragma warning(pop) @@ -1303,7 +1303,7 @@ inline void *wxUIntToPtr(wxUIntPtr p) #pragma warning(disable: 171) #endif - return wx_reinterpret_cast(void *, p); + return reinterpret_cast(p); #if defined(__VISUALC__) || defined(__INTELC__) #pragma warning(pop) diff --git a/include/wx/dlist.h b/include/wx/dlist.h index e0d23106e0..d25428de29 100644 --- a/include/wx/dlist.h +++ b/include/wx/dlist.h @@ -238,7 +238,7 @@ public: Node *GetNext() const { return m_next; } Node *GetPrevious() const { return m_previous; } T *GetData() const { return m_data; } - T **GetDataPtr() const { return &(wx_const_cast(nodetype*,this)->m_data); } + T **GetDataPtr() const { return &(const_cast(this)->m_data); } void SetData( T *data ) { m_data = data; } int IndexOf() const diff --git a/interface/wx/object.h b/interface/wx/object.h index 9baa53eb3f..b118edb38c 100644 --- a/interface/wx/object.h +++ b/interface/wx/object.h @@ -789,39 +789,6 @@ public: */ #define wxIMPLEMENT_CLASS2( className, baseClassName1, baseClassName2 ) -/** - Same as @c const_cast(x) if the compiler supports const cast or @c (T)x for - old compilers. Unlike wxConstCast(), the cast it to the type @c T and not to - T * and also the order of arguments is the same as for the standard cast. - - @header{wx/defs.h} - - @see wx_reinterpret_cast(), wx_static_cast() -*/ -#define wx_const_cast(T, x) - -/** - Same as @c reinterpret_cast(x) if the compiler supports reinterpret cast or - @c (T)x for old compilers. - - @header{wx/defs.h} - - @see wx_const_cast(), wx_static_cast() -*/ -#define wx_reinterpret_cast(T, x) - -/** - Same as @c static_cast(x) if the compiler supports static cast or @c (T)x for - old compilers. Unlike wxStaticCast(), there are no checks being done and - the meaning of the macro arguments is exactly the same as for the standard - static cast, i.e. @a T is the full type name and star is not appended to it. - - @header{wx/defs.h} - - @see wx_const_cast(), wx_reinterpret_cast(), wx_truncate_cast() -*/ -#define wx_static_cast(T, x) - /** This case doesn’t correspond to any standard cast but exists solely to make casts which possibly result in a truncation of an integer value more @@ -837,7 +804,7 @@ public: @header{wx/defs.h} - @see wx_const_cast(), wxDynamicCast(), wxStaticCast() + @see wxDynamicCast(), wxStaticCast() */ #define wxConstCast( ptr, classname ) @@ -889,7 +856,7 @@ public: @header{wx/object.h} - @see wx_static_cast(), wxDynamicCast(), wxConstCast() + @see wxDynamicCast(), wxConstCast() */ #define wxStaticCast( ptr, classname ) diff --git a/interface/wx/pickerbase.h b/interface/wx/pickerbase.h index 160cfaa04e..b50a964225 100644 --- a/interface/wx/pickerbase.h +++ b/interface/wx/pickerbase.h @@ -89,7 +89,7 @@ public: // wxMSW is one of the platforms where the generic implementation // of wxFilePickerCtrl is used... - wxButton *pButt = wx_static_cast(wxButton*, myFilePickerCtrl->GetPickerCtrl()); + wxButton *pButt = static_cast(myFilePickerCtrl->GetPickerCtrl()); if (pButt) pButt->SetLabel("Custom browse string"); #endif diff --git a/samples/xti/classlist.cpp b/samples/xti/classlist.cpp index 5cc8f5dc78..4b9ac66d74 100644 --- a/samples/xti/classlist.cpp +++ b/samples/xti/classlist.cpp @@ -262,7 +262,7 @@ void ClassListDialog::InitControls() bool ClassListDialog::IsToDiscard(const wxString &classname) const { - wxCheckBox *cb = wx_static_cast(wxCheckBox*, FindWindow(ID_SHOW_ONLY_XTI)); + wxCheckBox *cb = static_cast(FindWindow(ID_SHOW_ONLY_XTI)); if (!cb || !cb->IsChecked()) return false; @@ -288,7 +288,7 @@ void ClassListDialog::UpdateFilterText() void ClassListDialog::UpdateClassInfo(const wxString &itemName) { wxString classname = itemName.BeforeFirst(wxT(' ')); - wxCheckBox *cb = wx_static_cast(wxCheckBox*, FindWindow(ID_SHOW_PROPERTIES_RECURSIVELY)); + wxCheckBox *cb = static_cast(FindWindow(ID_SHOW_PROPERTIES_RECURSIVELY)); m_pTextCtrl->SetValue( DumpClassInfo(wxClassInfo::FindClass(classname), cb->IsChecked())); diff --git a/src/unix/glx11.cpp b/src/unix/glx11.cpp index 65346010c4..d409d6d578 100644 --- a/src/unix/glx11.cpp +++ b/src/unix/glx11.cpp @@ -671,7 +671,7 @@ bool wxGLCanvasX11::InitXVisualInfo(const wxGLAttributes& dispAttrs, { *pFBC = NULL; *pXVisual = glXChooseVisual(dpy, DefaultScreen(dpy), - wx_const_cast(int*, attrsListGLX) ); + const_cast(attrsListGLX) ); } return *pXVisual != NULL; From 8cfc74491a6c55c4f8ca057269df7a4bcde6a1ec Mon Sep 17 00:00:00 2001 From: ARATA Mizuki Date: Tue, 30 Aug 2016 17:44:32 +0900 Subject: [PATCH 2/4] Replace wxEXPLICIT with the 'explicit' keyword See #17655. --- include/wx/arrstr.h | 10 +++++----- include/wx/dataview.h | 2 +- include/wx/defs.h | 19 ++----------------- include/wx/dlist.h | 2 +- include/wx/font.h | 4 ++-- include/wx/generic/grideditors.h | 2 +- include/wx/generic/private/textmeasure.h | 4 ++-- include/wx/gtk/bitmap.h | 2 +- include/wx/gtk/glcanvas.h | 2 +- include/wx/gtk/private/textmeasure.h | 4 ++-- include/wx/gtk1/glcanvas.h | 2 +- include/wx/hashmap.h | 4 ++-- include/wx/hashset.h | 4 ++-- include/wx/iconloc.h | 6 +++--- include/wx/list.h | 2 +- include/wx/modalhook.h | 2 +- include/wx/msw/bitmap.h | 2 +- include/wx/msw/enhmeta.h | 2 +- include/wx/msw/glcanvas.h | 4 ++-- include/wx/msw/ole/oleutils.h | 2 +- include/wx/msw/private.h | 2 +- include/wx/msw/private/comptr.h | 2 +- include/wx/msw/private/pipestream.h | 4 ++-- include/wx/msw/private/textmeasure.h | 4 ++-- include/wx/object.h | 2 +- include/wx/private/addremovectrl.h | 12 ++++++------ .../wx/private/fdioeventloopsourcehandler.h | 2 +- include/wx/qt/bitmap.h | 2 +- include/wx/qt/glcanvas.h | 2 +- include/wx/scopedarray.h | 6 +++--- include/wx/scopedptr.h | 4 ++-- include/wx/scrolwin.h | 2 +- include/wx/sharedptr.h | 4 ++-- include/wx/unix/private/pipestream.h | 2 +- include/wx/vector.h | 4 ++-- include/wx/window.h | 2 +- include/wx/windowptr.h | 2 +- include/wx/x11/glcanvas.h | 2 +- interface/wx/defs.h | 11 ----------- interface/wx/sharedptr.h | 4 ++-- samples/dialogs/dialogs.cpp | 2 +- src/common/init.cpp | 2 +- src/common/wincmn.cpp | 6 +++--- src/gtk/spinctrl.cpp | 2 +- src/ribbon/bar.cpp | 2 +- tests/exec/exec.cpp | 2 +- 46 files changed, 73 insertions(+), 99 deletions(-) diff --git a/include/wx/arrstr.h b/include/wx/arrstr.h index 8b2a6325c9..9e2711acd9 100644 --- a/include/wx/arrstr.h +++ b/include/wx/arrstr.h @@ -105,7 +105,7 @@ public: for ( size_t n = 0; n < src.size(); n++ ) Add(src[n]); } - wxEXPLICIT wxSortedArrayString(wxArrayString::CompareFunction compareFunction) + explicit wxSortedArrayString(wxArrayString::CompareFunction compareFunction) : wxSortedArrayStringBase(compareFunction) { } @@ -151,7 +151,7 @@ public: // wouldn't be needed if the 'explicit' keyword was supported by all // compilers, or if this was protected ctor for wxSortedArrayString, // but we're stuck with it now. - wxEXPLICIT wxArrayString(int autoSort) { Init(autoSort != 0); } + explicit wxArrayString(int autoSort) { Init(autoSort != 0); } // C string array ctor wxArrayString(size_t sz, const char** a); wxArrayString(size_t sz, const wchar_t** a); @@ -263,7 +263,7 @@ public: public: pointer m_ptr; reverse_iterator() : m_ptr(NULL) { } - wxEXPLICIT reverse_iterator(pointer ptr) : m_ptr(ptr) { } + explicit reverse_iterator(pointer ptr) : m_ptr(ptr) { } reverse_iterator(const itor& it) : m_ptr(it.m_ptr) { } reference operator*() const { return *m_ptr; } pointer operator->() const { return m_ptr; } @@ -289,7 +289,7 @@ public: public: pointer m_ptr; const_reverse_iterator() : m_ptr(NULL) { } - wxEXPLICIT const_reverse_iterator(pointer ptr) : m_ptr(ptr) { } + explicit const_reverse_iterator(pointer ptr) : m_ptr(ptr) { } const_reverse_iterator(const itor& it) : m_ptr(it.m_ptr) { } const_reverse_iterator(const reverse_iterator& it) : m_ptr(it.m_ptr) { } reference operator*() const { return *m_ptr; } @@ -389,7 +389,7 @@ public: wxSortedArrayString(const wxArrayString& array) : wxArrayString(true) { Copy(array); } - wxEXPLICIT wxSortedArrayString(CompareFunction compareFunction) + explicit wxSortedArrayString(CompareFunction compareFunction) : wxArrayString(true) { m_compareFunction = compareFunction; } }; diff --git a/include/wx/dataview.h b/include/wx/dataview.h index 5039b437c2..d92a21eee9 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -87,7 +87,7 @@ class wxDataViewItem : public wxItemId { public: wxDataViewItem() : wxItemId() { } - wxEXPLICIT wxDataViewItem(void* pItem) : wxItemId(pItem) { } + explicit wxDataViewItem(void* pItem) : wxItemId(pItem) { } }; WX_DEFINE_ARRAY(wxDataViewItem, wxDataViewItemArray); diff --git a/include/wx/defs.h b/include/wx/defs.h index fe5fdb48f7..93db4d7c0e 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -229,23 +229,8 @@ typedef short int WXTYPE; /* wrap it in this guard, but such cases should still be relatively rare. */ #define wxUSE_NESTED_CLASSES 1 -/* check for explicit keyword support */ -#ifndef HAVE_EXPLICIT - #if defined(__VISUALC__) - #define HAVE_EXPLICIT - #elif defined(__GNUC__) - #define HAVE_EXPLICIT - #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x0520) - /* BC++ 4.52 doesn't support explicit, CBuilder 1 does */ - #define HAVE_EXPLICIT - #endif -#endif /* !HAVE_EXPLICIT */ - -#ifdef HAVE_EXPLICIT - #define wxEXPLICIT explicit -#else /* !HAVE_EXPLICIT */ - #define wxEXPLICIT -#endif /* HAVE_EXPLICIT/!HAVE_EXPLICIT */ +/* This macro is obsolete, use the 'explicit' keyword in the new code. */ +#define wxEXPLICIT explicit /* check for override keyword support */ #ifndef HAVE_OVERRIDE diff --git a/include/wx/dlist.h b/include/wx/dlist.h index d25428de29..e44e3e3e46 100644 --- a/include/wx/dlist.h +++ b/include/wx/dlist.h @@ -739,7 +739,7 @@ public: { return it.m_node == m_node; } }; - wxEXPLICIT wxDList(size_type n, const_reference v = value_type()) + explicit wxDList(size_type n, const_reference v = value_type()) { assign(n, v); } wxDList(const const_iterator& first, const const_iterator& last) { assign(first, last); } diff --git a/include/wx/font.h b/include/wx/font.h index cbd3cada8f..3e0ee14102 100644 --- a/include/wx/font.h +++ b/include/wx/font.h @@ -123,9 +123,9 @@ public: { InitPointSize(-1); } // These ctors specify the font size, either in points or in pixels. - wxEXPLICIT wxFontInfo(int pointSize) + explicit wxFontInfo(int pointSize) { InitPointSize(pointSize); } - wxEXPLICIT wxFontInfo(const wxSize& pixelSize) : m_pixelSize(pixelSize) + explicit wxFontInfo(const wxSize& pixelSize) : m_pixelSize(pixelSize) { Init(); } // Setters for the various attributes. All of them return the object itself diff --git a/include/wx/generic/grideditors.h b/include/wx/generic/grideditors.h index faa1007c65..c1b8206caa 100644 --- a/include/wx/generic/grideditors.h +++ b/include/wx/generic/grideditors.h @@ -53,7 +53,7 @@ private: class WXDLLIMPEXP_ADV wxGridCellTextEditor : public wxGridCellEditor { public: - wxEXPLICIT wxGridCellTextEditor(size_t maxChars = 0); + explicit wxGridCellTextEditor(size_t maxChars = 0); virtual void Create(wxWindow* parent, wxWindowID id, diff --git a/include/wx/generic/private/textmeasure.h b/include/wx/generic/private/textmeasure.h index 2b31d02831..6cd900e945 100644 --- a/include/wx/generic/private/textmeasure.h +++ b/include/wx/generic/private/textmeasure.h @@ -17,9 +17,9 @@ class wxTextMeasure : public wxTextMeasureBase { public: - wxEXPLICIT wxTextMeasure(const wxDC *dc, const wxFont *font = NULL) + explicit wxTextMeasure(const wxDC *dc, const wxFont *font = NULL) : wxTextMeasureBase(dc, font) {} - wxEXPLICIT wxTextMeasure(const wxWindow *win, const wxFont *font = NULL) + explicit wxTextMeasure(const wxWindow *win, const wxFont *font = NULL) : wxTextMeasureBase(win, font) {} protected: diff --git a/include/wx/gtk/bitmap.h b/include/wx/gtk/bitmap.h index 3b3cf99cff..ea54328dcf 100644 --- a/include/wx/gtk/bitmap.h +++ b/include/wx/gtk/bitmap.h @@ -82,7 +82,7 @@ public: wxBitmap(const wxImage& image, int depth = wxBITMAP_SCREEN_DEPTH, double scale = 1.0); #endif // wxUSE_IMAGE wxBitmap(GdkPixbuf* pixbuf, int depth = 0); - wxEXPLICIT wxBitmap(const wxCursor& cursor); + explicit wxBitmap(const wxCursor& cursor); virtual ~wxBitmap(); bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH) wxOVERRIDE; diff --git a/include/wx/gtk/glcanvas.h b/include/wx/gtk/glcanvas.h index f194e60f37..c60c601b8e 100644 --- a/include/wx/gtk/glcanvas.h +++ b/include/wx/gtk/glcanvas.h @@ -29,7 +29,7 @@ public: const wxString& name = wxGLCanvasName, const wxPalette& palette = wxNullPalette); - wxEXPLICIT // avoid implicitly converting a wxWindow* to wxGLCanvas + explicit // avoid implicitly converting a wxWindow* to wxGLCanvas wxGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY, const int *attribList = NULL, diff --git a/include/wx/gtk/private/textmeasure.h b/include/wx/gtk/private/textmeasure.h index d27b096f26..4620df08a0 100644 --- a/include/wx/gtk/private/textmeasure.h +++ b/include/wx/gtk/private/textmeasure.h @@ -19,13 +19,13 @@ class WXDLLIMPEXP_FWD_CORE wxWindowDCImpl; class wxTextMeasure : public wxTextMeasureBase { public: - wxEXPLICIT wxTextMeasure(const wxDC *dc, const wxFont *font = NULL) + explicit wxTextMeasure(const wxDC *dc, const wxFont *font = NULL) : wxTextMeasureBase(dc, font) { Init(); } - wxEXPLICIT wxTextMeasure(const wxWindow *win, const wxFont *font = NULL) + explicit wxTextMeasure(const wxWindow *win, const wxFont *font = NULL) : wxTextMeasureBase(win, font) { Init(); diff --git a/include/wx/gtk1/glcanvas.h b/include/wx/gtk1/glcanvas.h index 446344b860..73dcb27b59 100644 --- a/include/wx/gtk1/glcanvas.h +++ b/include/wx/gtk1/glcanvas.h @@ -29,7 +29,7 @@ public: const wxString& name = wxGLCanvasName, const wxPalette& palette = wxNullPalette); - wxEXPLICIT // avoid implicitly converting a wxWindow* to wxGLCanvas + explicit // avoid implicitly converting a wxWindow* to wxGLCanvas wxGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY, const int *attribList = NULL, diff --git a/include/wx/hashmap.h b/include/wx/hashmap.h index 121a1febdc..371407e5a9 100644 --- a/include/wx/hashmap.h +++ b/include/wx/hashmap.h @@ -640,8 +640,8 @@ public: \ typedef VALUE_T mapped_type; \ _WX_DECLARE_PAIR( iterator, bool, Insert_Result, CLASSEXP ) \ \ - wxEXPLICIT CLASSNAME( size_type hint = 100, hasher hf = hasher(), \ - key_equal eq = key_equal() ) \ + explicit CLASSNAME( size_type hint = 100, hasher hf = hasher(), \ + key_equal eq = key_equal() ) \ : CLASSNAME##_wxImplementation_HashTable( hint, hf, eq, \ CLASSNAME##_wxImplementation_KeyEx() ) {} \ \ diff --git a/include/wx/hashset.h b/include/wx/hashset.h index 8cd1becf9b..38a65ab5f4 100644 --- a/include/wx/hashset.h +++ b/include/wx/hashset.h @@ -123,8 +123,8 @@ CLASSEXP CLASSNAME:public CLASSNAME##_wxImplementation_HashTable \ public: \ _WX_DECLARE_PAIR( iterator, bool, Insert_Result, CLASSEXP ) \ \ - wxEXPLICIT CLASSNAME( size_type hint = 100, hasher hf = hasher(), \ - key_equal eq = key_equal() ) \ + explicit CLASSNAME( size_type hint = 100, hasher hf = hasher(), \ + key_equal eq = key_equal() ) \ : CLASSNAME##_wxImplementation_HashTable( hint, hf, eq, \ CLASSNAME##_wxImplementation_KeyEx() ) {} \ \ diff --git a/include/wx/iconloc.h b/include/wx/iconloc.h index 9baaaa5297..bce75aa83e 100644 --- a/include/wx/iconloc.h +++ b/include/wx/iconloc.h @@ -21,7 +21,7 @@ class WXDLLIMPEXP_BASE wxIconLocationBase { public: // ctor takes the name of the file where the icon is - wxEXPLICIT wxIconLocationBase(const wxString& filename = wxEmptyString) + explicit wxIconLocationBase(const wxString& filename = wxEmptyString) : m_filename(filename) { } // default copy ctor, assignment operator and dtor are ok @@ -47,7 +47,7 @@ class WXDLLIMPEXP_BASE wxIconLocation : public wxIconLocationBase public: // ctor takes the name of the file where the icon is and the icons index in // the file - wxEXPLICIT wxIconLocation(const wxString& file = wxEmptyString, int num = 0); + explicit wxIconLocation(const wxString& file = wxEmptyString, int num = 0); // set/get the icon index void SetIndex(int num) { m_index = num; } @@ -70,7 +70,7 @@ wxIconLocation::wxIconLocation(const wxString& file, int num) class WXDLLIMPEXP_BASE wxIconLocation : public wxIconLocationBase { public: - wxEXPLICIT wxIconLocation(const wxString& filename = wxEmptyString) + explicit wxIconLocation(const wxString& filename = wxEmptyString) : wxIconLocationBase(filename) { } }; diff --git a/include/wx/list.h b/include/wx/list.h index 9278a4f148..4644c22c3b 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -942,7 +942,7 @@ private: { return it.m_node == m_node; } \ }; \ \ - wxEXPLICIT name(size_type n, const_reference v = value_type()) \ + explicit name(size_type n, const_reference v = value_type()) \ { assign(n, v); } \ name(const const_iterator& first, const const_iterator& last) \ { assign(first, last); } \ diff --git a/include/wx/modalhook.h b/include/wx/modalhook.h index 55341f9bd9..a60b77e389 100644 --- a/include/wx/modalhook.h +++ b/include/wx/modalhook.h @@ -77,7 +77,7 @@ private: class wxModalDialogHookExitGuard { public: - wxEXPLICIT wxModalDialogHookExitGuard(wxDialog* dialog) + explicit wxModalDialogHookExitGuard(wxDialog* dialog) : m_dialog(dialog) { } diff --git a/include/wx/msw/bitmap.h b/include/wx/msw/bitmap.h index 4ebc108894..4fbc62f7dc 100644 --- a/include/wx/msw/bitmap.h +++ b/include/wx/msw/bitmap.h @@ -98,7 +98,7 @@ public: } // Convert from wxCursor - wxEXPLICIT wxBitmap(const wxCursor& cursor) + explicit wxBitmap(const wxCursor& cursor) { (void)CopyFromCursor(cursor, wxBitmapTransparency_Auto); } diff --git a/include/wx/msw/enhmeta.h b/include/wx/msw/enhmeta.h index b3ae3bb4c6..b501b2d752 100644 --- a/include/wx/msw/enhmeta.h +++ b/include/wx/msw/enhmeta.h @@ -96,7 +96,7 @@ public: // as above, but takes reference DC as first argument to take resolution, // size, font metrics etc. from - wxEXPLICIT + explicit wxEnhMetaFileDC(const wxDC& referenceDC, const wxString& filename = wxEmptyString, int width = 0, int height = 0, diff --git a/include/wx/msw/glcanvas.h b/include/wx/msw/glcanvas.h index fdcdd1faa5..0e05c01e35 100644 --- a/include/wx/msw/glcanvas.h +++ b/include/wx/msw/glcanvas.h @@ -47,7 +47,7 @@ private: class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasBase { public: - wxEXPLICIT // avoid implicitly converting a wxWindow* to wxGLCanvas + explicit // avoid implicitly converting a wxWindow* to wxGLCanvas wxGLCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs, wxWindowID id = wxID_ANY, @@ -57,7 +57,7 @@ public: const wxString& name = wxGLCanvasName, const wxPalette& palette = wxNullPalette); - wxEXPLICIT + explicit wxGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY, const int *attribList = NULL, diff --git a/include/wx/msw/ole/oleutils.h b/include/wx/msw/ole/oleutils.h index 57a99fb445..befb693189 100644 --- a/include/wx/msw/ole/oleutils.h +++ b/include/wx/msw/ole/oleutils.h @@ -285,7 +285,7 @@ private: class WXDLLIMPEXP_CORE wxVariantDataSafeArray : public wxVariantData { public: - wxEXPLICIT wxVariantDataSafeArray(SAFEARRAY* value = NULL) + explicit wxVariantDataSafeArray(SAFEARRAY* value = NULL) { m_value = value; } diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 6af753ff27..1abdbaa4e8 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -157,7 +157,7 @@ template class AutoHANDLE { public: - wxEXPLICIT AutoHANDLE(HANDLE handle = InvalidHandle()) : m_handle(handle) { } + explicit AutoHANDLE(HANDLE handle = InvalidHandle()) : m_handle(handle) { } bool IsOk() const { return m_handle != InvalidHandle(); } operator HANDLE() const { return m_handle; } diff --git a/include/wx/msw/private/comptr.h b/include/wx/msw/private/comptr.h index 194cf54f90..2b21cfa82e 100644 --- a/include/wx/msw/private/comptr.h +++ b/include/wx/msw/private/comptr.h @@ -25,7 +25,7 @@ public: { } - wxEXPLICIT wxCOMPtr(T* ptr) + explicit wxCOMPtr(T* ptr) : m_ptr(ptr) { if ( m_ptr ) diff --git a/include/wx/msw/private/pipestream.h b/include/wx/msw/private/pipestream.h index ba6d032bea..23df2b8943 100644 --- a/include/wx/msw/private/pipestream.h +++ b/include/wx/msw/private/pipestream.h @@ -13,7 +13,7 @@ class wxPipeInputStream : public wxInputStream { public: - wxEXPLICIT wxPipeInputStream(HANDLE hInput); + explicit wxPipeInputStream(HANDLE hInput); virtual ~wxPipeInputStream(); // returns true if the pipe is still opened @@ -34,7 +34,7 @@ protected: class wxPipeOutputStream: public wxOutputStream { public: - wxEXPLICIT wxPipeOutputStream(HANDLE hOutput); + explicit wxPipeOutputStream(HANDLE hOutput); virtual ~wxPipeOutputStream() { Close(); } bool Close(); diff --git a/include/wx/msw/private/textmeasure.h b/include/wx/msw/private/textmeasure.h index ee14751a5b..2c890a9fad 100644 --- a/include/wx/msw/private/textmeasure.h +++ b/include/wx/msw/private/textmeasure.h @@ -19,13 +19,13 @@ class wxTextMeasure : public wxTextMeasureBase { public: - wxEXPLICIT wxTextMeasure(const wxDC *dc, const wxFont *font = NULL) + explicit wxTextMeasure(const wxDC *dc, const wxFont *font = NULL) : wxTextMeasureBase(dc, font) { Init(); } - wxEXPLICIT wxTextMeasure(const wxWindow *win, const wxFont *font = NULL) + explicit wxTextMeasure(const wxWindow *win, const wxFont *font = NULL) : wxTextMeasureBase(win, font) { Init(); diff --git a/include/wx/object.h b/include/wx/object.h index 6a0140737b..1dd57cd654 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -268,7 +268,7 @@ class wxObjectDataPtr public: typedef T element_type; - wxEXPLICIT wxObjectDataPtr(T *ptr = NULL) : m_ptr(ptr) {} + explicit wxObjectDataPtr(T *ptr = NULL) : m_ptr(ptr) {} // copy ctor wxObjectDataPtr(const wxObjectDataPtr &tocopy) diff --git a/include/wx/private/addremovectrl.h b/include/wx/private/addremovectrl.h index adb349f646..19540e8df1 100644 --- a/include/wx/private/addremovectrl.h +++ b/include/wx/private/addremovectrl.h @@ -24,9 +24,9 @@ public: // class is supposed to create the buttons and layout everything. // // Takes ownership of the adaptor pointer. - wxEXPLICIT wxAddRemoveImplBase(wxAddRemoveAdaptor* adaptor, - wxAddRemoveCtrl* WXUNUSED(parent), - wxWindow* ctrlItems) + explicit wxAddRemoveImplBase(wxAddRemoveAdaptor* adaptor, + wxAddRemoveCtrl* WXUNUSED(parent), + wxWindow* ctrlItems) : m_adaptor(adaptor) { ctrlItems->Bind(wxEVT_CHAR, &wxAddRemoveImplBase::OnChar, this); @@ -105,9 +105,9 @@ private: class wxAddRemoveImplWithButtons : public wxAddRemoveImplBase { public: - wxEXPLICIT wxAddRemoveImplWithButtons(wxAddRemoveAdaptor* adaptor, - wxAddRemoveCtrl* parent, - wxWindow* ctrlItems) + explicit wxAddRemoveImplWithButtons(wxAddRemoveAdaptor* adaptor, + wxAddRemoveCtrl* parent, + wxWindow* ctrlItems) : wxAddRemoveImplBase(adaptor, parent, ctrlItems) { m_btnAdd = diff --git a/include/wx/private/fdioeventloopsourcehandler.h b/include/wx/private/fdioeventloopsourcehandler.h index 5ac17de240..fcf67622bf 100644 --- a/include/wx/private/fdioeventloopsourcehandler.h +++ b/include/wx/private/fdioeventloopsourcehandler.h @@ -19,7 +19,7 @@ class wxFDIOEventLoopSourceHandler : public wxFDIOHandler { public: - wxEXPLICIT wxFDIOEventLoopSourceHandler(wxEventLoopSourceHandler* handler) + explicit wxFDIOEventLoopSourceHandler(wxEventLoopSourceHandler* handler) : m_handler(handler) { } diff --git a/include/wx/qt/bitmap.h b/include/wx/qt/bitmap.h index b804551bf6..aee92f648b 100644 --- a/include/wx/qt/bitmap.h +++ b/include/wx/qt/bitmap.h @@ -32,7 +32,7 @@ public: // Convert from wxIcon / wxCursor wxBitmap(const wxIcon& icon) { CopyFromIcon(icon); } - wxEXPLICIT wxBitmap(const wxCursor& cursor); + explicit wxBitmap(const wxCursor& cursor); static void InitStandardHandlers(); diff --git a/include/wx/qt/glcanvas.h b/include/wx/qt/glcanvas.h index 73c5b54957..13cce8a2ea 100644 --- a/include/wx/qt/glcanvas.h +++ b/include/wx/qt/glcanvas.h @@ -31,7 +31,7 @@ private: class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasBase { public: - wxEXPLICIT // avoid implicitly converting a wxWindow* to wxGLCanvas + explicit // avoid implicitly converting a wxWindow* to wxGLCanvas wxGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY, const int *attribList = NULL, diff --git a/include/wx/scopedarray.h b/include/wx/scopedarray.h index 2f80911fa2..02455d7385 100644 --- a/include/wx/scopedarray.h +++ b/include/wx/scopedarray.h @@ -24,8 +24,8 @@ class wxScopedArray public: typedef T element_type; - wxEXPLICIT wxScopedArray(T * array = NULL) : m_array(array) { } - wxEXPLICIT wxScopedArray(size_t count) : m_array(new T[count]) { } + explicit wxScopedArray(T * array = NULL) : m_array(array) { } + explicit wxScopedArray(size_t count) : m_array(new T[count]) { } ~wxScopedArray() { delete [] m_array; } @@ -77,7 +77,7 @@ private: \ name & operator=(name const &); \ \ public: \ - wxEXPLICIT name(T * p = NULL) : m_ptr(p) \ + explicit name(T * p = NULL) : m_ptr(p) \ {} \ \ ~name(); \ diff --git a/include/wx/scopedptr.h b/include/wx/scopedptr.h index ea83299fec..784e99d00e 100644 --- a/include/wx/scopedptr.h +++ b/include/wx/scopedptr.h @@ -40,7 +40,7 @@ class wxScopedPtr public: typedef T element_type; - wxEXPLICIT wxScopedPtr(T * ptr = NULL) : m_ptr(ptr) { } + explicit wxScopedPtr(T * ptr = NULL) : m_ptr(ptr) { } ~wxScopedPtr() { wxCHECKED_DELETE(m_ptr); } @@ -123,7 +123,7 @@ private: \ name & operator=(name const &); \ \ public: \ - wxEXPLICIT name(T * ptr = NULL) \ + explicit name(T * ptr = NULL) \ : m_ptr(ptr) { } \ \ ~name(); \ diff --git a/include/wx/scrolwin.h b/include/wx/scrolwin.h index e8f4ac8386..3c4a870aca 100644 --- a/include/wx/scrolwin.h +++ b/include/wx/scrolwin.h @@ -64,7 +64,7 @@ enum wxScrollbarVisibility class WXDLLIMPEXP_CORE wxAnyScrollHelperBase { public: - wxEXPLICIT wxAnyScrollHelperBase(wxWindow* win); + explicit wxAnyScrollHelperBase(wxWindow* win); virtual ~wxAnyScrollHelperBase() {} // Disable use of keyboard keys for scrolling. By default cursor movement diff --git a/include/wx/sharedptr.h b/include/wx/sharedptr.h index a9b6442c09..67618c2b1b 100644 --- a/include/wx/sharedptr.h +++ b/include/wx/sharedptr.h @@ -23,7 +23,7 @@ class wxSharedPtr public: typedef T element_type; - wxEXPLICIT wxSharedPtr( T* ptr = NULL ) + explicit wxSharedPtr( T* ptr = NULL ) : m_ref(NULL) { if (ptr) @@ -31,7 +31,7 @@ public: } template - wxEXPLICIT wxSharedPtr(T* ptr, Deleter d) + explicit wxSharedPtr(T* ptr, Deleter d) : m_ref(NULL) { if (ptr) diff --git a/include/wx/unix/private/pipestream.h b/include/wx/unix/private/pipestream.h index 313a271741..2fa44e0062 100644 --- a/include/wx/unix/private/pipestream.h +++ b/include/wx/unix/private/pipestream.h @@ -15,7 +15,7 @@ class wxPipeInputStream : public wxFileInputStream { public: - wxEXPLICIT wxPipeInputStream(int fd) : wxFileInputStream(fd) { } + explicit wxPipeInputStream(int fd) : wxFileInputStream(fd) { } // return true if the pipe is still opened bool IsOpened() const { return !Eof(); } diff --git a/include/wx/vector.h b/include/wx/vector.h index 4eb0f856f4..686dc0a587 100644 --- a/include/wx/vector.h +++ b/include/wx/vector.h @@ -145,7 +145,7 @@ public: { public: reverse_iterator() : m_ptr(NULL) { } - wxEXPLICIT reverse_iterator(iterator it) : m_ptr(it) { } + explicit reverse_iterator(iterator it) : m_ptr(it) { } reverse_iterator(const reverse_iterator& it) : m_ptr(it.m_ptr) { } reference operator*() const { return *m_ptr; } @@ -189,7 +189,7 @@ public: { public: const_reverse_iterator() : m_ptr(NULL) { } - wxEXPLICIT const_reverse_iterator(const_iterator it) : m_ptr(it) { } + explicit const_reverse_iterator(const_iterator it) : m_ptr(it) { } const_reverse_iterator(const reverse_iterator& it) : m_ptr(it.m_ptr) { } const_reverse_iterator(const const_reverse_iterator& it) : m_ptr(it.m_ptr) { } diff --git a/include/wx/window.h b/include/wx/window.h index c5bac6248f..ca168dd6fd 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -581,7 +581,7 @@ public: public: // Notice that window can be NULL here, for convenience. In this case // this class simply doesn't do anything. - wxEXPLICIT ChildrenRepositioningGuard(wxWindowBase* win) + explicit ChildrenRepositioningGuard(wxWindowBase* win) : m_win(win), m_callEnd(win && win->BeginRepositioningChildren()) { diff --git a/include/wx/windowptr.h b/include/wx/windowptr.h index bebcf6ad8f..b4ac928068 100644 --- a/include/wx/windowptr.h +++ b/include/wx/windowptr.h @@ -35,7 +35,7 @@ class wxWindowPtr : public wxSharedPtr public: typedef T element_type; - wxEXPLICIT wxWindowPtr(element_type* win) + explicit wxWindowPtr(element_type* win) : wxSharedPtr(win, wxPrivate::wxWindowDeleter()) { } diff --git a/include/wx/x11/glcanvas.h b/include/wx/x11/glcanvas.h index a02e0ba4b9..d6bfe79da7 100644 --- a/include/wx/x11/glcanvas.h +++ b/include/wx/x11/glcanvas.h @@ -26,7 +26,7 @@ public: const wxString& name = wxGLCanvasName, const wxPalette& palette = wxNullPalette); - wxEXPLICIT // avoid implicitly converting a wxWindow* to wxGLCanvas + explicit // avoid implicitly converting a wxWindow* to wxGLCanvas wxGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY, const int *attribList = NULL, diff --git a/interface/wx/defs.h b/interface/wx/defs.h index 37e226bedc..7d4a954270 100644 --- a/interface/wx/defs.h +++ b/interface/wx/defs.h @@ -1699,17 +1699,6 @@ template wxDELETEA(T*& array); */ #define wxDEPRECATED_BUT_USED_INTERNALLY_INLINE(func, body) -/** - @c wxEXPLICIT is a macro which expands to the C++ @c explicit keyword if - the compiler supports it or nothing otherwise. Thus, it can be used even in - the code which might have to be compiled with an old compiler without - support for this language feature but still take advantage of it when it is - available. - - @header{wx/defs.h} -*/ -#define wxEXPLICIT - /** @c wxOVERRIDE expands to the C++11 @c override keyword if it's supported by the compiler or nothing otherwise. diff --git a/interface/wx/sharedptr.h b/interface/wx/sharedptr.h index 8b7087baed..52900275a4 100644 --- a/interface/wx/sharedptr.h +++ b/interface/wx/sharedptr.h @@ -26,7 +26,7 @@ public: Creates shared pointer from the raw pointer @a ptr and takes ownership of it. */ - wxEXPLICIT wxSharedPtr(T* ptr = NULL); + explicit wxSharedPtr(T* ptr = NULL); /** Constructor. @@ -42,7 +42,7 @@ public: @since 3.0 */ template - wxEXPLICIT wxSharedPtr(T* ptr, Deleter d); + explicit wxSharedPtr(T* ptr, Deleter d); /** Copy constructor. diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 23e7e5c4d9..7ddc6701a5 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -1368,7 +1368,7 @@ void MyFrame::AddRemove(wxCommandEvent& WXUNUSED(event)) class ListBoxAdaptor : public wxAddRemoveAdaptor { public: - wxEXPLICIT ListBoxAdaptor(wxListBox* lbox) + explicit ListBoxAdaptor(wxListBox* lbox) : m_lbox(lbox) { } diff --git a/src/common/init.cpp b/src/common/init.cpp index 7e47e6007b..5a3b521d0f 100644 --- a/src/common/init.cpp +++ b/src/common/init.cpp @@ -82,7 +82,7 @@ wxDEFINE_SCOPED_PTR(wxAppConsole, wxAppPtrBase) class wxAppPtr : public wxAppPtrBase { public: - wxEXPLICIT wxAppPtr(wxAppConsole *ptr = NULL) : wxAppPtrBase(ptr) { } + explicit wxAppPtr(wxAppConsole *ptr = NULL) : wxAppPtrBase(ptr) { } ~wxAppPtr() { if ( get() ) diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index d9f52733c7..67f2933a17 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -2022,7 +2022,7 @@ namespace class ValidationTraverserBase { public: - wxEXPLICIT ValidationTraverserBase(wxWindowBase* win) + explicit ValidationTraverserBase(wxWindowBase* win) : m_win(static_cast(win)) { } @@ -2084,7 +2084,7 @@ bool wxWindowBase::Validate() class ValidateTraverser : public ValidationTraverserBase { public: - wxEXPLICIT ValidateTraverser(wxWindowBase* win) + explicit ValidateTraverser(wxWindowBase* win) : ValidationTraverserBase(win) { } @@ -2112,7 +2112,7 @@ bool wxWindowBase::TransferDataToWindow() class DataToWindowTraverser : public ValidationTraverserBase { public: - wxEXPLICIT DataToWindowTraverser(wxWindowBase* win) + explicit DataToWindowTraverser(wxWindowBase* win) : ValidationTraverserBase(win) { } diff --git a/src/gtk/spinctrl.cpp b/src/gtk/spinctrl.cpp index b33593cf59..5a22d6fbe4 100644 --- a/src/gtk/spinctrl.cpp +++ b/src/gtk/spinctrl.cpp @@ -83,7 +83,7 @@ gtk_changed(GtkSpinButton* spinbutton, wxSpinCtrl* win) class wxSpinCtrlEventDisabler { public: - wxEXPLICIT wxSpinCtrlEventDisabler(wxSpinCtrlGTKBase* spin) + explicit wxSpinCtrlEventDisabler(wxSpinCtrlGTKBase* spin) : m_spin(spin) { m_spin->GtkDisableEvents(); diff --git a/src/ribbon/bar.cpp b/src/ribbon/bar.cpp index 3592078144..304f92c7c0 100644 --- a/src/ribbon/bar.cpp +++ b/src/ribbon/bar.cpp @@ -490,7 +490,7 @@ void wxRibbonBar::SetTabCtrlMargins(int left, int right) struct PageComparedBySmallWidthAsc { - wxEXPLICIT PageComparedBySmallWidthAsc(wxRibbonPageTabInfo* page) + explicit PageComparedBySmallWidthAsc(wxRibbonPageTabInfo* page) : m_page(page) { } diff --git a/tests/exec/exec.cpp b/tests/exec/exec.cpp index d102b43d6d..ca77c08783 100644 --- a/tests/exec/exec.cpp +++ b/tests/exec/exec.cpp @@ -302,7 +302,7 @@ void ExecTestCase::TestProcess() class TestAsyncProcess : public wxProcess { public: - wxEXPLICIT TestAsyncProcess() + explicit TestAsyncProcess() { } From 32666e8d4f9fa2853c93cb79fc64ee1799832bbf Mon Sep 17 00:00:00 2001 From: ARATA Mizuki Date: Fri, 9 Sep 2016 20:20:59 +0900 Subject: [PATCH 3/4] Remove feature test for HAVE_EXPLICIT --- acinclude.m4 | 47 -------------------- configure | 80 ----------------------------------- configure.in | 3 -- include/wx/defs.h | 2 +- include/wx/osx/config_xcode.h | 1 - setup.h.in | 5 --- setup.h_vms | 5 --- 7 files changed, 1 insertion(+), 142 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index f0868de4da..08486d3e61 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -208,53 +208,6 @@ AC_DEFUN([WX_CPP_NEW_HEADERS], AC_LANG_RESTORE ]) -dnl --------------------------------------------------------------------------- -dnl WX_CPP_EXPLICIT checks whether the C++ compiler support the explicit -dnl keyword and defines HAVE_EXPLICIT if this is the case -dnl --------------------------------------------------------------------------- - -AC_DEFUN([WX_CPP_EXPLICIT], -[ - AC_CACHE_CHECK([if C++ compiler supports the explicit keyword], - wx_cv_explicit, - [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - - dnl do the test in 2 steps: first check that the compiler knows about the - dnl explicit keyword at all and then verify that it really honours it - AC_TRY_COMPILE( - [ - class Foo { public: explicit Foo(int) {} }; - ], - [ - return 0; - ], - [ - AC_TRY_COMPILE( - [ - class Foo { public: explicit Foo(int) {} }; - static void TakeFoo(const Foo& foo) { } - ], - [ - TakeFoo(17); - return 0; - ], - wx_cv_explicit=no, - wx_cv_explicit=yes - ) - ], - wx_cv_explicit=no - ) - - AC_LANG_RESTORE - ]) - - if test "$wx_cv_explicit" = "yes"; then - AC_DEFINE(HAVE_EXPLICIT) - fi -]) - dnl --------------------------------------------------------------------------- dnl WX_CHECK_FUNCS(FUNCTIONS..., dnl [ACTION-IF-FOUND], diff --git a/configure b/configure index fb8476aeae..81c9025278 100755 --- a/configure +++ b/configure @@ -18988,86 +18988,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if C++ compiler supports the explicit keyword" >&5 -$as_echo_n "checking if C++ compiler supports the explicit keyword... " >&6; } -if ${wx_cv_explicit+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - class Foo { public: explicit Foo(int) {} }; - -int -main () -{ - - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - class Foo { public: explicit Foo(int) {} }; - static void TakeFoo(const Foo& foo) { } - -int -main () -{ - - TakeFoo(17); - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - wx_cv_explicit=no -else - wx_cv_explicit=yes - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -else - wx_cv_explicit=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_explicit" >&5 -$as_echo "$wx_cv_explicit" >&6; } - - if test "$wx_cv_explicit" = "yes"; then - $as_echo "#define HAVE_EXPLICIT 1" >>confdefs.h - - fi - - ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' diff --git a/configure.in b/configure.in index 15b95395ee..317a0de223 100644 --- a/configure.in +++ b/configure.in @@ -1802,9 +1802,6 @@ if test "$HAVE_CXX11" != "1" ; then dnl check for iostream (as opposed to iostream.h) standard header WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH)) -dnl check whether C++ compiler supports explicit keyword -WX_CPP_EXPLICIT - dnl the next few tests are all for C++ features and so need to be done using dnl C++ compiler AC_LANG_PUSH(C++) diff --git a/include/wx/defs.h b/include/wx/defs.h index 93db4d7c0e..eece8810a2 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -258,7 +258,7 @@ typedef short int WXTYPE; #define wxOVERRIDE override #else /* !HAVE_OVERRIDE */ #define wxOVERRIDE -#endif /* HAVE_OVERRIDE/!HAVE_EXPLICIT */ +#endif /* HAVE_OVERRIDE */ /* wxFALLTHROUGH is used to notate explicit fallthroughs in switch statements */ diff --git a/include/wx/osx/config_xcode.h b/include/wx/osx/config_xcode.h index ca0619bc78..0146ec98b1 100644 --- a/include/wx/osx/config_xcode.h +++ b/include/wx/osx/config_xcode.h @@ -21,7 +21,6 @@ #define __DARWIN__ 1 #define wx_USE_NANOX 0 -#define HAVE_EXPLICIT 1 #define HAVE_VA_COPY 1 #define HAVE_VARIADIC_MACROS 1 #define HAVE_STD_WSTRING 1 diff --git a/setup.h.in b/setup.h.in index 06c9fc942d..23807726dc 100644 --- a/setup.h.in +++ b/setup.h.in @@ -712,11 +712,6 @@ #define wxUSE_CRASHREPORT 0 /* --- end MSW options --- */ -/* - * Define if your compiler supports the explicit keyword - */ -#undef HAVE_EXPLICIT - /* * Define if your compiler has C99 va_copy */ diff --git a/setup.h_vms b/setup.h_vms index f93c131e1c..08624f8647 100644 --- a/setup.h_vms +++ b/setup.h_vms @@ -781,11 +781,6 @@ typedef pid_t GPid; /* --- end MSW options --- */ -/* - * Define if your compiler supports the explicit keyword - */ -#define HAVE_EXPLICIT 1 - /* * Define if your compiler has C99 va_copy */ From affbcfa6c4261e27c208123ebc237b1d9f963bfa Mon Sep 17 00:00:00 2001 From: ARATA Mizuki Date: Tue, 30 Aug 2016 18:13:02 +0900 Subject: [PATCH 4/4] Remove HAVE_PARTIAL_SPECIALIZATION and HAVE_TEMPLATE_OVERLOAD_RESOLUTION macros See #17655. --- include/wx/defs.h | 25 ------------------------- include/wx/strvararg.h | 6 ------ 2 files changed, 31 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index eece8810a2..1a35a67ba7 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -443,31 +443,6 @@ typedef short int WXTYPE; #undef wxNO_WOSTREAM #endif /* HAVE_WOSTREAM */ -/* ---------------------------------------------------------------------------- */ -/* other C++ features */ -/* ---------------------------------------------------------------------------- */ - -#ifndef HAVE_PARTIAL_SPECIALIZATION - /* be optimistic by default */ - #define HAVE_PARTIAL_SPECIALIZATION -#endif - -#ifdef __VISUALC__ - #if __VISUALC__ < 1310 - #undef HAVE_PARTIAL_SPECIALIZATION - #endif -#endif /* __VISUALC__ */ - - -#ifndef HAVE_TEMPLATE_OVERLOAD_RESOLUTION - /* assume the compiler can use type or const expressions as template - arguments if it supports partial specialization -- except if it's a - Borland one which can't */ - #if defined(HAVE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__) - #define HAVE_TEMPLATE_OVERLOAD_RESOLUTION - #endif /* (HAVE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__) */ -#endif /* !defined(HAVE_TEMPLATE_OVERLOAD_RESOLUTION) */ - /* ---------------------------------------------------------------------------- */ /* portable calling conventions macros */ /* ---------------------------------------------------------------------------- */ diff --git a/include/wx/strvararg.h b/include/wx/strvararg.h index 468cbf8bbb..57429045d4 100644 --- a/include/wx/strvararg.h +++ b/include/wx/strvararg.h @@ -362,17 +362,12 @@ struct wxFormatStringSpecifier // // Furthermore, if the compiler doesn't have partial template // specialization, we didn't cover pointers either. -#ifdef HAVE_PARTIAL_SPECIALIZATION enum { value = wxFormatString::Arg_Int }; -#else - enum { value = wxFormatString::Arg_Int | wxFormatString::Arg_Pointer }; -#endif }; #endif // HAVE_TR1_TYPE_TRAITS/!HAVE_TR1_TYPE_TRAITS -#ifdef HAVE_PARTIAL_SPECIALIZATION template struct wxFormatStringSpecifier { @@ -384,7 +379,6 @@ struct wxFormatStringSpecifier { enum { value = wxFormatString::Arg_Pointer }; }; -#endif // !HAVE_PARTIAL_SPECIALIZATION #define wxFORMAT_STRING_SPECIFIER(T, arg) \