P99
Macros
A small collection of utilities
+ Collaboration diagram for A small collection of utilities:

Macros

#define __has_attribute(X)   p00_has_attribute_ ## X
 
#define __has_builtin(X)   p00_has_builtin_ ## X
 
#define __has_extension   __has_feature
 
#define __has_feature(X)   p00_has_feature_ ## X
 
#define P99_ATLEAST   static
 Specify for array parameters that they have a least a given number of elements. More...
 
#define P99_CONST_FUNCTION
 On architectures that support this, assert that a function is "const", i.e only depends on parameters and global variables. More...
 
#define P99_DEPRECATED(...)   /*! \deprecated __VA_ARGS__ */
 Deprecate a declaration that is given as the argument list. More...
 
#define P99_EXPECT(EXP, VAL)   (EXP)
 Provide a compiler hint concerning the likelihood of a certain value in an expression EXP. More...
 
#define p99_extension
 Mark an expression as using a compiler extension. More...
 
#define P99_FIXED_REGISTER(REG)
 Fix a variable to a specific register, if the platform supports this. More...
 
#define p99_has_attribute(X)   (__has_attribute(X) || p00_has_attribute_ ## X)
 
#define p99_has_builtin(X)   (__has_builtin(X) || p00_has_builtin_ ## X)
 
#define p99_has_extension(X)   (__has_extension(X) || p00_has_extension_ ## X)
 
#define p99_has_feature(X)   (__has_feature(X) || p00_has_feature_ ## X)
 
#define P99_IF_COMPILER(COMP, ...)   P00_COMPILER_PRAGMA_ ## COMP(P99_STRINGIFY(__VA_ARGS__))
 Issue the pragma that is given as a supplementary argument iff the actual compiler is COMP. More...
 
#define p99_inline   static inline
 Try to force a function always to be inlined. More...
 
#define P99_LIKELY(...)   P99_EXPECT(!!(__VA_ARGS__), 1)
 Mark the conditional expression as being likely. More...
 
#define P99_MACRO_END(...)   extern void P99_PASTE(p00_harmless_declaration_, __VA_ARGS__)(void)
 A meta macro that forces the addition of a semicolon after a call to the macro that it terminates. More...
 
#define P99_PARALLEL_PRAGMA
 A token sequence that can be used in a #pragma directive to indicate a parallel for-loop. More...
 
#define P99_PURE_FUNCTION
 On architectures that support this, assert that a function is "pure", i.e only depends on parameters and global variables. More...
 
#define P99_SETJMP_INLINE(NAME)   P99_WEAK(NAME)
 
#define P99_STRINGIFY(...)   P00_STRINGIFY(__VA_ARGS__)
 Transform the argument list into one string. More...
 
#define P99_TENTATIVE_DEC(T, NAME)   P00_TENTATIVE_DEC(NAME) T NAME
 A tentative declaration of an object NAME of type T. More...
 
#define P99_TENTATIVE_DEF(T, NAME)   P00_TENTATIVE_DEF(NAME) T NAME
 
#define P99_UNLIKELY(...)   P99_EXPECT(!!(__VA_ARGS__), 0)
 Mark the conditional expression as being unlikely. More...
 
#define P99_VECTOR(T, NAME, N)   _Alignas(sizeof(T)*(N)) T NAME[N]
 A wrapper for vector type extensions. More...
 
#define P99_WARN_UNUSED_RESULT
 On architectures that support this, warn if the result of a function is not used. More...
 
#define P99_WEAK(...)   P99_IF_LT(P99_NARG(__VA_ARGS__), 2)(P00_WEAK1(__VA_ARGS__))(P00_WEAK2(__VA_ARGS__))
 Declare a symbol to be weak such that it can be provided several times without error. More...
 
#define static_inline   static inline
 

Detailed Description

P99_WEAK
#define P99_WEAK(...)
Declare a symbol to be weak such that it can be provided several times without error.
Definition: p99_compiler.h:561