summaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2018-08-07 23:24:07 -0700
committerGitHub <noreply@github.com>2018-08-07 23:24:07 -0700
commit047e75b485ad16a729083c210ba4064943d2e7c5 (patch)
treecbd0ac11a061cb6da426e44bd6684f6115fecc88 /src/base
parent95e9918607ed879347bb250ecbaa3c5c557d71b4 (diff)
Require Swig 3 (#2283)
Removes some hacks due to Swig 2's incomplete C++11 support and adds checks for version 3 at configuration time as well as in swig.h
Diffstat (limited to 'src/base')
-rw-r--r--src/base/Makefile.am3
-rw-r--r--src/base/cvc4_assert.cpp5
-rw-r--r--src/base/exception.cpp2
-rw-r--r--src/base/exception.h4
-rw-r--r--src/base/tls.h31
5 files changed, 5 insertions, 40 deletions
diff --git a/src/base/Makefile.am b/src/base/Makefile.am
index 7dd6f47e5..3619b226e 100644
--- a/src/base/Makefile.am
+++ b/src/base/Makefile.am
@@ -28,8 +28,7 @@ libbase_la_SOURCES = \
listener.h \
modal_exception.h \
output.cpp \
- output.h \
- tls.h
+ output.h
# listing {Debug,Trace}_tags too ensures that make doesn't auto-remove it
# after building (if it does, we don't get the "cached" effect with
diff --git a/src/base/cvc4_assert.cpp b/src/base/cvc4_assert.cpp
index 1e92670b4..3af6a9909 100644
--- a/src/base/cvc4_assert.cpp
+++ b/src/base/cvc4_assert.cpp
@@ -20,14 +20,13 @@
#include "base/cvc4_assert.h"
#include "base/output.h"
-#include "base/tls.h"
using namespace std;
namespace CVC4 {
#ifdef CVC4_DEBUG
-//CVC4_THREAD_LOCAL const char* s_debugLastException = NULL;
+//thread_local const char* s_debugLastException = NULL;
#endif /* CVC4_DEBUG */
@@ -141,7 +140,7 @@ void AssertionException::construct(const char* header, const char* extra,
*/
void debugAssertionFailed(const AssertionException& thisException,
const char* propagatingException) {
- static CVC4_THREAD_LOCAL bool alreadyFired = false;
+ static thread_local bool alreadyFired = false;
if(__builtin_expect( ( !std::uncaught_exception() ), true ) || alreadyFired) {
throw thisException;
diff --git a/src/base/exception.cpp b/src/base/exception.cpp
index 0a651f773..831220a2b 100644
--- a/src/base/exception.cpp
+++ b/src/base/exception.cpp
@@ -28,7 +28,7 @@ using namespace std;
namespace CVC4 {
-CVC4_THREAD_LOCAL LastExceptionBuffer* LastExceptionBuffer::s_currentBuffer = NULL;
+thread_local LastExceptionBuffer* LastExceptionBuffer::s_currentBuffer = NULL;
LastExceptionBuffer::LastExceptionBuffer() : d_contents(NULL) {}
diff --git a/src/base/exception.h b/src/base/exception.h
index 983a59572..54f6aa92d 100644
--- a/src/base/exception.h
+++ b/src/base/exception.h
@@ -27,8 +27,6 @@
#include <stdexcept>
#include <string>
-#include "base/tls.h"
-
namespace CVC4 {
class CVC4_PUBLIC Exception : public std::exception {
@@ -163,7 +161,7 @@ private:
char* d_contents;
- static CVC4_THREAD_LOCAL LastExceptionBuffer* s_currentBuffer;
+ static thread_local LastExceptionBuffer* s_currentBuffer;
}; /* class LastExceptionBuffer */
}/* CVC4 namespace */
diff --git a/src/base/tls.h b/src/base/tls.h
deleted file mode 100644
index d80d66d30..000000000
--- a/src/base/tls.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/********************* */
-/*! \file tls.h
- ** \verbatim
- ** Top contributors (to current version):
- ** Andres Noetzli
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief Definiton of CVC4_THREAD_LOCAL
- **
- ** This header defines CVC4_THREAD_LOCAL, which should be used instead of
- ** thread_local because it is not supported by all build types (e.g. Swig).
- **/
-
-#include "cvc4_public.h"
-
-#ifndef __CVC4__BASE__TLS_H
-#define __CVC4__BASE__TLS_H
-
-#if SWIG && (!defined(SWIG_VERSION) || SWIG_VERSION < 0x030000)
-// SWIG versions older than 3.0 do not support thread_local, so just redefine
-// CVC4_THREAD_LOCAL to be empty for those versions.
-#define CVC4_THREAD_LOCAL
-#else
-#define CVC4_THREAD_LOCAL thread_local
-#endif
-
-#endif /* __CVC4__BASE__TLS_H */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback