Subastra
Loading...
Searching...
No Matches
Macros | Typedefs
defs.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
Include dependency graph for defs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PANIC_(msg)
 
#define PANIC(msg, ...)
 
#define ASSERT__(expr)
 
#define ASSERT_(expr, msg)
 
#define ASSERT(expr, msg, ...)
 
#define FLOAT32_INFTY   (__builtin_inff())
 
#define FLOAT32_NEG_INFTY   (-__builtin_inff())
 

Typedefs

typedef uint32_t u32
 
typedef uint64_t u64
 
typedef int32_t i32
 
typedef uint16_t u16
 
typedef unsigned char byte
 
typedef char i8
 
typedef size_t sz
 

Macro Definition Documentation

◆ ASSERT

#define ASSERT (   expr,
  msg,
  ... 
)
Value:
do { \
if (!(expr)) \
PANIC("not ok!\tAssertion Failed! " msg, __VA_ARGS__); \
} while (0)

◆ ASSERT_

#define ASSERT_ (   expr,
  msg 
)
Value:
do { \
if (!(expr)) \
PANIC_("not ok!\tAsserton Failed! " msg); \
} while (0)

◆ ASSERT__

#define ASSERT__ (   expr)
Value:
do { \
if (!(expr)) \
PANIC_("not ok!.\tAsserton Failed! " #expr); \
else \
fprintf(stderr, "# %s:%d\t\tok.\t%s\n", __FILE__, __LINE__, #expr); \
} while (0)

◆ FLOAT32_INFTY

#define FLOAT32_INFTY   (__builtin_inff())

◆ FLOAT32_NEG_INFTY

#define FLOAT32_NEG_INFTY   (-__builtin_inff())

◆ PANIC

#define PANIC (   msg,
  ... 
)
Value:
do { \
fprintf(stderr, "%s:%d\t\t" msg "\n", __FILE__, __LINE__, __VA_ARGS__); \
abort(); \
} while (0)

◆ PANIC_

#define PANIC_ (   msg)
Value:
do { \
fprintf(stderr, "%s:%d\t\t" msg "\n", __FILE__, __LINE__); \
abort(); \
} while (0)

Typedef Documentation

◆ byte

typedef unsigned char byte

◆ i32

typedef int32_t i32

◆ i8

typedef char i8

◆ sz

typedef size_t sz

◆ u16

typedef uint16_t u16

◆ u32

typedef uint32_t u32

◆ u64

typedef uint64_t u64