SDL Utility
Util.hpp File Reference

Basic utility macros, typedefs... More...

#include <cstdint>

Go to the source code of this file.

Macros

#define PI   3.1415926f
 
#define IS_NULLPTR(x)   (x == nullptr)
 
#define RETURN_IF_NULLPTR(x, ...)   { if(IS_NULLPTR(x)) return __VA_ARGS__; }
 
#define RETURN_IF_NOT_NULLPTR(x, ...)   { if(!IS_NULLPTR(x)) return __VA_ARGS__; }
 
#define THROW_IF(condition, exception)   ( condition ? throw exception : false)
 
#define THROW_IF_NOT(condition, exception)   ( THROW_IF(!condition, exception) )
 
#define SDLU_BEGIN   namespace sdlu {
 

Typedefs

typedef uint8_t Uint8
 
typedef int8_t Int8
 
typedef uint16_t Uint16
 
typedef int16_t Int16
 
typedef uint32_t Uint32
 
typedef int32_t Int32
 
typedef uint64_t Uint64
 
typedef int64_t Int64
 

Detailed Description

Basic utility macros, typedefs...

Author
Lauchmelder23
Date
16.05.2020

Macro Definition Documentation

◆ IS_NULLPTR

#define IS_NULLPTR (   x)    (x == nullptr)

◆ PI

#define PI   3.1415926f

◆ RETURN_IF_NOT_NULLPTR

#define RETURN_IF_NOT_NULLPTR (   x,
  ... 
)    { if(!IS_NULLPTR(x)) return __VA_ARGS__; }

◆ RETURN_IF_NULLPTR

#define RETURN_IF_NULLPTR (   x,
  ... 
)    { if(IS_NULLPTR(x)) return __VA_ARGS__; }

◆ SDLU_BEGIN

#define SDLU_BEGIN   namespace sdlu {

◆ THROW_IF

#define THROW_IF (   condition,
  exception 
)    ( condition ? throw exception : false)

◆ THROW_IF_NOT

#define THROW_IF_NOT (   condition,
  exception 
)    ( THROW_IF(!condition, exception) )

Typedef Documentation

◆ Int16

typedef int16_t Int16

◆ Int32

typedef int32_t Int32

◆ Int64

typedef int64_t Int64

◆ Int8

typedef int8_t Int8

◆ Uint16

typedef uint16_t Uint16

◆ Uint32

typedef uint32_t Uint32

◆ Uint64

typedef uint64_t Uint64

◆ Uint8

typedef uint8_t Uint8