[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
263/376: Fix build on gcc < 4.7
From: |
Ludovic Courtès |
Subject: |
263/376: Fix build on gcc < 4.7 |
Date: |
Wed, 28 Jan 2015 22:05:30 +0000 |
civodul pushed a commit to tag 1.8
in repository guix.
commit 6062b121605b298c73ddf11688b075ed78a46df2
Author: Shea Levy <address@hidden>
Date: Mon Oct 20 12:15:50 2014 -0400
Fix build on gcc < 4.7
---
src/libexpr/eval.hh | 3 +++
src/libutil/types.hh | 13 +++++++++++++
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index daf5384..51ab1b1 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -340,6 +340,9 @@ struct InvalidPathError : EvalError
{
Path path;
InvalidPathError(const Path & path);
+#ifdef EXCEPTION_NEEDS_THROW_SPEC
+ ~InvalidPathError() throw () { };
+#endif
};
/* Realise all paths in `context' */
diff --git a/src/libutil/types.hh b/src/libutil/types.hh
index 906a959..160884e 100644
--- a/src/libutil/types.hh
+++ b/src/libutil/types.hh
@@ -8,6 +8,15 @@
#include <boost/format.hpp>
+/* Before 4.7, gcc's std::exception uses empty throw() specifiers for
+ * its (virtual) destructor and what() in c++11 mode, in violation of spec
+ */
+#ifdef __GNUC__
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)
+#define EXCEPTION_NEEDS_THROW_SPEC
+#endif
+#endif
+
namespace nix {
@@ -39,8 +48,12 @@ protected:
public:
unsigned int status; // exit status
BaseError(const FormatOrString & fs, unsigned int status = 1);
+#ifdef EXCEPTION_NEEDS_THROW_SPEC
~BaseError() throw () { };
const char * what() const throw () { return err.c_str(); }
+#else
+ const char * what() const noexcept { return err.c_str(); }
+#endif
const string & msg() const { return err; }
const string & prefix() const { return prefix_; }
BaseError & addPrefix(const FormatOrString & fs);
- 298/376: Fix bad operator, (continued)
- 298/376: Fix bad operator, Ludovic Courtès, 2015/01/28
- 270/376: Revert "Temporarily disable darwin builds while hydra's darwin is borked", Ludovic Courtès, 2015/01/28
- 283/376: Doh, Ludovic Courtès, 2015/01/28
- 300/376: import derivation: cleanup, Ludovic Courtès, 2015/01/28
- 264/376: Temporarily disable darwin builds while hydra's darwin is borked, Ludovic Courtès, 2015/01/28
- 291/376: Fix message, Ludovic Courtès, 2015/01/28
- 273/376: Fix more warnings, Ludovic Courtès, 2015/01/28
- 258/376: Fix nix-copy-closure --from, Ludovic Courtès, 2015/01/28
- 260/376: Drop support for pre-c++11 compilers., Ludovic Courtès, 2015/01/28
- 262/376: Revert "Drop support for pre-c++11 compilers.", Ludovic Courtès, 2015/01/28
- 263/376: Fix build on gcc < 4.7,
Ludovic Courtès <=
- 244/376: Show total allocations, Ludovic Courtès, 2015/01/28
- 293/376: Remove Hydra build product, Ludovic Courtès, 2015/01/28
- 279/376: Add a launchd configuration file to run nix-daemon, Ludovic Courtès, 2015/01/28
- 251/376: nix-channel --add: Validate URL / channel ID, Ludovic Courtès, 2015/01/28
- 252/376: Remove redundant space in usage errors, Ludovic Courtès, 2015/01/28
- 290/376: realiseContext: Handle all context types, Ludovic Courtès, 2015/01/28
- 276/376: Improve error message if the daemon worker fails to start, Ludovic Courtès, 2015/01/28
- 267/376: Remove comments claiming we use a private PID namespace, Ludovic Courtès, 2015/01/28
- 237/376: Don't recompile the same regex over and over, Ludovic Courtès, 2015/01/28
- 297/376: Build Ubuntu 14.10 package, Ludovic Courtès, 2015/01/28