Fix an exception safety hole in ScopeGuard
[folly.git] / folly / detail / FunctionalExcept.h
index 4c698c84a47c1317bb381f7d36f568282cf0d269..b0018779d7dd34b79d4b5cd39bc907755983671b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,6 +19,8 @@
 
 #include <folly/Portability.h>
 
+#if !FOLLY_HAVE_BITS_FUNCTEXCEPT_H
+
 FOLLY_NAMESPACE_STD_BEGIN
 
 FOLLY_NORETURN void __throw_length_error(const char* msg);
@@ -31,4 +33,8 @@ FOLLY_NORETURN void __throw_bad_alloc();
 
 FOLLY_NAMESPACE_STD_END
 
+#else
+#error This file should never be included if FOLLY_HAVE_BITS_FUNCTEXCEPT_H is set
+#endif
+
 #endif