[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
107/118: Fix build on gcc < 4.7
From: |
Ludovic Courtès |
Subject: |
107/118: Fix build on gcc < 4.7 |
Date: |
Tue, 19 May 2015 14:46:01 +0000 |
civodul pushed a commit to branch nix
in repository guix.
commit bed17f40fce27e1a31f70957b1d0dd912b58700d
Author: Shea Levy <address@hidden>
Date: Mon Oct 20 12:15:50 2014 -0400
Fix build on gcc < 4.7
---
nix/libutil/types.hh | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/nix/libutil/types.hh b/nix/libutil/types.hh
index 906a959..160884e 100644
--- a/nix/libutil/types.hh
+++ b/nix/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);
- 104/118: createDirs(): Handle ‘path’ being a symlink, (continued)
- 104/118: createDirs(): Handle ‘path’ being a symlink, Ludovic Courtès, 2015/05/19
- 103/118: nix-daemon: Close unnecessary fd, Ludovic Courtès, 2015/05/19
- 97/118: Introduce allowedRequisites feature, Ludovic Courtès, 2015/05/19
- 113/118: Clean up temp roots in a more C++ way, Ludovic Courtès, 2015/05/19
- 105/118: Remove some duplicate code, Ludovic Courtès, 2015/05/19
- 108/118: Improve error message if the daemon worker fails to start, Ludovic Courtès, 2015/05/19
- 100/118: Settings: Add bool get(), Ludovic Courtès, 2015/05/19
- 106/118: Improved error message when encountering unsupported file types, Ludovic Courtès, 2015/05/19
- 114/118: nix-daemon: Call exit(), not _exit(), Ludovic Courtès, 2015/05/19
- 99/118: Add an 'optimiseStore' remote procedure call., Ludovic Courtès, 2015/05/19
- 107/118: Fix build on gcc < 4.7,
Ludovic Courtès <=
- 98/118: Add disallowedReferences / disallowedRequisites, Ludovic Courtès, 2015/05/19
- 110/118: Make ~DerivationGoal more reliable, Ludovic Courtès, 2015/05/19
- 111/118: Don't use ADDR_LIMIT_3GB, Ludovic Courtès, 2015/05/19
- 115/118: Disable vacuuming the DB after garbage collection, Ludovic Courtès, 2015/05/19
- 117/118: Build derivations in a more predictable order, Ludovic Courtès, 2015/05/19
- 109/118: nix-store --gc: Don't warn about missing manifests directory, Ludovic Courtès, 2015/05/19
- 118/118: Don't wait for PID -1, Ludovic Courtès, 2015/05/19
- 112/118: Fix message, Ludovic Courtès, 2015/05/19
- 116/118: Don't create unnecessary substitution goals for derivations, Ludovic Courtès, 2015/05/19