X-Git-Url: https://pd.if.org/git/?p=pdclib.old;a=blobdiff_plain;f=internals%2F_PDCLIB_aux.h;h=0a31e86969f81b4f49cc649bdcc090462fcb95d3;hp=bc13897a7d4254383cc3890499c69ba7459f4a09;hb=d1954049a406af2992113a783539aa5d86cfdfa8;hpb=0e4e0ed2c33d36149cdd1bf0e67cfb630c6c8210 diff --git a/internals/_PDCLIB_aux.h b/internals/_PDCLIB_aux.h index bc13897..0a31e86 100644 --- a/internals/_PDCLIB_aux.h +++ b/internals/_PDCLIB_aux.h @@ -1,5 +1,5 @@ -#ifndef _PDCLIB_AUX_H -#define _PDCLIB_AUX_H +#ifndef __PDCLIB_AUX_H +#define __PDCLIB_AUX_H __PDCLIB_AUX_H /* Auxiliary PDCLib code <_PDCLIB_aux.h> @@ -181,6 +181,15 @@ #define _PDCLIB_DEPRECATED __attribute__ ((__deprecated__)) #endif +#if !defined(_PDCLIB_UNREACHABLE) && _PDCLIB_GCC_BUILTIN(__builtin_unreachable, 4, 0) + #define _PDCLIB_UNREACHABLE __builtin_unreachable() +#endif + +#if !defined(_PDCLIB_UNDEFINED) && defined(__GNUC__) + #define _PDCLIB_UNDEFINED(_var) \ + do { __asm__("" : "=X"(_var)); } while(0) +#endif + /* No-op fallbacks */ #ifndef _PDCLIB_nothrow @@ -224,6 +233,14 @@ #define _PDCLIB_DEPRECATED #endif +#ifndef _PDCLIB_UNREACHABLE + #define _PDCLIB_UNREACHABLE do {} while(0) +#endif + +#ifndef _PDCLIB_UNDEFINED + #define _PDCLIB_UNDEFINED(_var) do {} while(0) +#endif + /*#if _PDCLIB_C_VERSION != 1999 #error PDCLib might not be fully conforming to either C89 or C95 prior to v2.x. #endif*/