#ifdef __cplusplus
extern "C"
#endif
- _Noreturn void __assert_fail(const char *, const char *, unsigned, const char *);
+ _Noreturn void __assert_fail(const char *, const char *, unsigned, const char *) __NOEXCEPT;
#define assert(e) \
((e) ? (void)0 : __assert_fail(#e, __FILE__, __LINE__, __PRETTY_FUNCTION__))
#undef _Thread_local
#define _Thread_local thread_local
+#undef __NOEXCEPT
+#define __NOEXCEPT noexcept
+
#else // not __cplusplus
#undef __BEGIN_C_DECLS
#undef __restrict
#define __restrict restrict // C99 and above support the restrict keyword.
+#undef __NOEXCEPT
+#define __NOEXCEPT
+
#endif // __cplusplus
#endif // LLVM_LIBC___COMMON_H
#include <errno.h>
#include <limits.h>
-#include <string.h>
using __llvm_libc::testing::ErrnoSetterMatcher::Fails;
using __llvm_libc::testing::ErrnoSetterMatcher::Succeeds;
#include <errno.h>
#include <limits.h>
-#include <string.h>
using __llvm_libc::testing::ErrnoSetterMatcher::Fails;
using __llvm_libc::testing::ErrnoSetterMatcher::Succeeds;
if (i < size - 1)
OS << ", ";
}
- OS << "), decltype(" << entrypoint << ")>, ";
+ OS << ") __NOEXCEPT, decltype(" << entrypoint << ")>, ";
OS << '"' << entrypoint
<< " prototype in TableGen does not match public header" << '"';
OS << ");\n";
// We provide dummy malloc and free implementations to support the case
// when LLVM libc does to include them.
- OS << "void *malloc(size_t) { return nullptr; }\n";
- OS << "void *realloc(void *, size_t) { return nullptr; }\n";
- OS << "void free(void *) {}\n";
+ OS << "void *malloc(size_t) __NOEXCEPT { return nullptr; }\n";
+ OS << "void *realloc(void *, size_t) __NOEXCEPT { return nullptr; }\n";
+ OS << "void free(void *) __NOEXCEPT {}\n";
return false;
}
OS << ", ";
}
- OS << ");\n\n";
+ OS << ") __NOEXCEPT;\n\n";
}
// Make another pass over entrypoints to emit object declarations.