use compiler extension instead of C11 noreturn
C11 noreturn isn't available in C++.
This commit is contained in:
parent
7106bff27f
commit
d8817417cc
2
new.cc
2
new.cc
@ -1,8 +1,6 @@
|
|||||||
#include <bits/functexcept.h>
|
#include <bits/functexcept.h>
|
||||||
#include <new>
|
#include <new>
|
||||||
|
|
||||||
#define noreturn
|
|
||||||
|
|
||||||
#include "h_malloc.h"
|
#include "h_malloc.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
4
util.h
4
util.h
@ -2,7 +2,9 @@
|
|||||||
#define UTIL_H
|
#define UTIL_H
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdnoreturn.h>
|
|
||||||
|
// C11 noreturn doesn't work in C++
|
||||||
|
#define noreturn __attribute__((noreturn))
|
||||||
|
|
||||||
#define likely(x) __builtin_expect(!!(x), 1)
|
#define likely(x) __builtin_expect(!!(x), 1)
|
||||||
#define unlikely(x) __builtin_expect(!!(x), 0)
|
#define unlikely(x) __builtin_expect(!!(x), 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user