diff --git a/common/xash3d_types.h b/common/xash3d_types.h index e4d27bb6..bf9cd239 100644 --- a/common/xash3d_types.h +++ b/common/xash3d_types.h @@ -73,7 +73,7 @@ typedef uint64_t longtime_t; #if defined( __GNUC__ ) #if defined( __i386__ ) #define EXPORT __attribute__(( visibility( "default" ), force_align_arg_pointer )) - #define GAME_EXPORT __attribute(( force_align_arg_pointer )) + #define GAME_EXPORT __attribute__(( force_align_arg_pointer )) #else #define EXPORT __attribute__(( visibility ( "default" ))) #define GAME_EXPORT @@ -91,6 +91,12 @@ typedef uint64_t longtime_t; #endif #define NORETURN __attribute__(( noreturn )) #define NONNULL __attribute__(( nonnull )) + #define RETURNS_NONNULL __attribute__(( returns_nonnull )) + #if __clang__ + #define PFN_RETURNS_NONNULL // clang has bugged returns_nonnull for functions pointers, it's ignored and generates a warning about objective-c? O_o + #else + #define PFN_RETURNS_NONNULL RETURNS_NONNULL + #endif #define FORMAT_CHECK( x ) __attribute__(( format( printf, x, x + 1 ))) #define ALLOC_CHECK( x ) __attribute__(( alloc_size( x ))) #define NO_ASAN __attribute__(( no_sanitize( "address" ))) @@ -107,6 +113,8 @@ typedef uint64_t longtime_t; #define GAME_EXPORT #define NORETURN #define NONNULL + #define RETURNS_NONNULL + #define PFN_RETURNS_NONNULL #define FORMAT_CHECK( x ) #define ALLOC_CHECK( x ) #define RENAME_SYMBOL( x )