Skip to content

Commit 18f0d80

Browse files
authored
maintained C++20 compatibility for Linux (#7268) (#7269)
#changelog #linux
1 parent 312ad3c commit 18f0d80

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

libs/openFrameworks/gl/ofGLBaseTypes.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ template<typename T>
7676
class ofBaseImage_: public ofAbstractImage, virtual public ofBaseHasPixels_<T>{
7777
public:
7878
/// \brief Destroy the ofBaseImage_.
79-
virtual ~ofBaseImage_<T>(){};
79+
virtual ~ofBaseImage_(){};
8080
};
8181

8282

@@ -439,7 +439,7 @@ class ofBaseGLRenderer: public ofBaseRenderer{
439439
/// \param material The material to bind to this renderer.
440440
/// \sa glMaterialfv()
441441
virtual void bind(const ofBaseMaterial & material)=0;
442-
442+
443443
virtual void bind(const ofShadow & shadow)=0;
444444
virtual void bind(const ofShadow & shadow, GLenum aCubeFace)=0;
445445

@@ -473,7 +473,7 @@ class ofBaseGLRenderer: public ofBaseRenderer{
473473
///
474474
/// \param material The material that is currently bound to this renderer.
475475
virtual void unbind(const ofBaseMaterial & material)=0;
476-
476+
477477
virtual void unbind(const ofShadow & shadow)=0;
478478
virtual void unbind(const ofShadow & shadow, GLenum aCubeFace)=0;
479479

libs/openFrameworks/graphics/ofGraphicsBaseTypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ template<typename T>
257257
class ofBaseHasPixels_: public ofAbstractHasPixels{
258258
public:
259259
/// \brief Destroy the ofAbstractHasPixels.
260-
virtual ~ofBaseHasPixels_<T>(){}
260+
virtual ~ofBaseHasPixels_(){}
261261

262262
/// \brief Get a reference to the underlying ofPixels.
263263
/// \returns a reference the underlying ofPixels.

libs/openFrameworksCompiled/project/makefileCommon/config.linux.common.mk

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ PLATFORM_REQUIRED_ADDONS =
137137

138138
PLATFORM_CXXFLAGS = -Wall -Werror=return-type
139139
PLATFORM_CXXVER = -std=c++17
140-
140+
141141
GCC_MAJOR := $(shell expr `gcc -dumpversion | cut -f1 -d.`)
142142
GCC_MINOR := $(shell expr `gcc -dumpversion | cut -f2 -d.`)
143143

@@ -159,12 +159,17 @@ ifeq ("$(GCC_MAJOR)","4")
159159
endif
160160
endif
161161
else
162-
ifeq ($(shell expr $(GCC_MAJOR) \>= 8), 1)
163-
# c++17 for gcc 8 and newer
164-
PLATFORM_CXXVER = -std=c++17
162+
ifeq ($(shell expr $(GCC_MAJOR) \>= 10), 1)
163+
# c++20 for gcc 10 and newer
164+
PLATFORM_CXXVER = -std=c++20
165165
else
166-
# c++14 for gcc 4 and newer
167-
PLATFORM_CXXVER = -std=c++14
166+
ifeq ($(shell expr $(GCC_MAJOR) \>= 8), 1)
167+
# c++17 for gcc 8 and newer
168+
PLATFORM_CXXVER = -std=c++17
169+
else
170+
# c++14 for gcc 4 and newer
171+
PLATFORM_CXXVER = -std=c++14
172+
endif
168173
endif
169174
PLATFORM_CXXFLAGS += -DGCC_HAS_REGEX
170175
endif

0 commit comments

Comments
 (0)