Version 2.0.0-0

macros Reference

File
lib/system/include/system/macros.h
Date
Wednesday, June 25, 2014
Includes
None

Macros

__XEOS_LIB_SYSTEM_MACROS_H__ Top

#define __XEOS_LIB_SYSTEM_MACROS_H__

CONST_ATTRIBUTE Top

Standardization of the const compiler attribute

#if ( defined( __GNUC__ ) && ( ( __GNUC__ >= 4 ) || ( ( __GNUC__ == 3 ) && ( __GNUC_MINOR__ >= 1 ) ) ) ) || defined( __clang__ ) #define CONST_ATTRIBUTE __attribute__( ( const ) ) #else #define CONST_ATTRIBUTE #endif

Discussion

Not all compiler support this attribute, so it may be defined to nothing.

DEPRECATED_ATTRIBUTE Top

Standardization of the deprecated compiler attribute

#if ( defined( __GNUC__ ) && ( ( __GNUC__ >= 4 ) || ( ( __GNUC__ == 3 ) && ( __GNUC_MINOR__ >= 1 ) ) ) ) || defined( __clang__ ) #define DEPRECATED_ATTRIBUTE __attribute__( ( deprecated ) ) #else #define DEPRECATED_ATTRIBUTE #endif

Discussion

Not all compiler support this attribute, so it may be defined to nothing.

FORMAT_ATTRIBUTE Top

Standardization of the format compiler attribute

#if ( defined( __GNUC__ ) && ( ( __GNUC__ >= 4 ) || ( ( __GNUC__ == 3 ) && ( __GNUC_MINOR__ >= 1 ) ) ) ) || defined( __clang__ ) #define FORMAT_ATTRIBUTE( f, s, v ) __attribute__( ( format( f, s, v ) ) ) #else #define FORMAT_ATTRIBUTE( f, s, v ) #endif

Discussion

Not all compiler support this attribute, so it may be defined to nothing.

LIKELY Top

#define LIKELY( _x_ ) __builtin_expect( !!( _x_ ), 1 )

LIKELY Top

#define LIKELY( _x_ ) !!( _x_ )

NORETURN_ATTRIBUTE Top

Standardization of the noreturn compiler attribute

#if ( defined( __GNUC__ ) && ( ( __GNUC__ >= 4 ) || ( ( __GNUC__ == 3 ) && ( __GNUC_MINOR__ >= 1 ) ) ) ) || defined( __clang__ ) #define NORETURN_ATTRIBUTE __attribute__( ( noreturn ) ) #else #define NORETURN_ATTRIBUTE #endif

Discussion

Not all compiler support this attribute, so it may be defined to nothing.

UNAVAILABLE_ATTRIBUTE Top

Standardization of the unavailable compiler attribute

#if ( defined( __GNUC__ ) && ( ( __GNUC__ >= 4 ) || ( ( __GNUC__ == 3 ) && ( __GNUC_MINOR__ >= 1 ) ) ) ) || defined( __clang__ ) #define UNAVAILABLE_ATTRIBUTE __attribute__( ( unavailable ) ) #else #define UNAVAILABLE_ATTRIBUTE #endif

Discussion

Not all compiler support this attribute, so it may be defined to nothing.

UNLIKELY Top

#define UNLIKELY( _x_ ) __builtin_expect( !!( _x_ ), 0 )

UNLIKELY Top

#define UNLIKELY( _x_ ) !!( _x_ )

WEAK_ATTRIBUTE Top

Standardization of the weak compiler attribute

#if ( defined( __GNUC__ ) && ( ( __GNUC__ >= 4 ) || ( ( __GNUC__ == 3 ) && ( __GNUC_MINOR__ >= 1 ) ) ) ) || defined( __clang__ ) #define WEAK_ATTRIBUTE __attribute__( ( weak ) ) #else #define WEAK_ATTRIBUTE #endif

Discussion

Not all compiler support this attribute, so it may be defined to nothing.

WEAK_IMPORT_ATTRIBUTE Top

Standardization of the weak import compiler attribute

#if ( defined( __GNUC__ ) && ( ( __GNUC__ >= 4 ) || ( ( __GNUC__ == 3 ) && ( __GNUC_MINOR__ >= 1 ) ) ) ) || defined( __clang__ ) #define WEAK_IMPORT_ATTRIBUTE __attribute__( ( weak_import ) ) #else #define WEAK_IMPORT_ATTRIBUTE #endif

Discussion

Not all compiler support this attribute, so it may be defined to nothing.