Skip to content

Commit

Permalink
Added full C++11 check and allowed gcc 4.7 as partial
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikołaj Małecki authored and rndi committed Aug 12, 2019
1 parent e7d9e99 commit c46cf08
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/srt-tunnel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <udt.h> // This TEMPORARILY contains extra C++-only SRT API.
#include <logging.h>
#include <api.h>
#include <utilities.h>

/*
# MAF contents for this file. Note that not every file from the support
Expand Down Expand Up @@ -382,10 +383,10 @@ class SrtMedium: public Medium
friend class Medium;
public:

#ifndef _MSC_VER
#ifdef HAVE_FULL_CXX11
using Medium::Medium;

#else // MSVC not exactly supports C++11
#else // MSVC and gcc 4.7 not exactly support C++11

SrtMedium(UriParser u, size_t ch): Medium(u, ch) {}

Expand Down
11 changes: 11 additions & 0 deletions srtcore/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,21 @@ written by

#if defined(__cplusplus) && __cplusplus > 199711L
#define HAVE_CXX11 1
#define HAVE_FULL_CXX11 1
#define ATR_NOEXCEPT noexcept
#define ATR_CONSTEXPR constexpr
#define ATR_OVERRIDE override
#define ATR_FINAL final

// For gcc 4.7, claim C++11 is supported, as long as experimental C++0x is on,
// however it's only the "most required C++11 support".
#elif defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC_MINOR__ >= 7 // 4.7 only!
#define HAVE_CXX11 1
#define ATR_NOEXCEPT
#define ATR_CONSTEXPR
#define ATR_OVERRIDE
#define ATR_FINAL

// Microsoft Visual Studio supports C++11, but not fully,
// and still did not change the value of __cplusplus. Treat
// this special way.
Expand Down

0 comments on commit c46cf08

Please sign in to comment.