SH4ZAM! 0.1.0
Fast math library for the Sega Dreamcast's SH4 CPU
Loading...
Searching...
No Matches
shz_cdefs.h File Reference
#include <stdint.h>
#include <assert.h>
Include dependency graph for shz_cdefs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SHZ_BACKEND
 
#define SHZ_TLS_MODEL
 
Back-Ends

Platform-specific SH4ZAM implementations.

#define SHZ_SH4
 
#define SHZ_PPC
 
#define SHZ_MIPS
 
#define SHZ_ARM
 
#define SHZ_X86
 
#define SHZ_WASM
 
#define SHZ_SW
 
TLS Models

Defines for different mechanisms for thread-local storage.

#define SHZ_TLS_DISABLED
 
#define SHZ_TLS_IMPLICIT
 
#define SHZ_TLS_PTHREAD
 
#define SHZ_TLS_CTHREAD
 
Compiler Detection

Defines for identifying the detected compiler.

#define SHZ_GNUC
 
Utilities

Miscellaneous function-like macros

#define SHZ_STRINGIFY_LITERAL(a)
 
#define SHZ_STRINGIFY(a)
 
#define SHZ_COUNT_OF(array)
 
#define SHZ_CONTAINER_OF(ptr, type, member)
 
#define SHZ_SWAP(a, b)
 
#define SHZ_DECLARE_STRUCT(n, t)
 
#define SHZ_DECLARE_STRUCT_ALIGNED(n, t, a)
 
TLS Utilities

Macros for declaring and managing thread-local variables.

#define SHZ_TLS_DECL(type, name, ...)
 
#define SHZ_TLS_REF(name)
 

Typedefs

Aliasing Types

Types which may break C/C++'s strict aliasing rules

typedef SHZ_ALIASING int16_t shz_alias_int16_t
 
typedef SHZ_ALIASING uint16_t shz_alias_uint16_t
 
typedef SHZ_ALIASING int32_t shz_alias_int32_t
 
typedef SHZ_ALIASING uint32_t shz_alias_uint32_t
 
typedef SHZ_ALIASING float shz_alias_float_t
 
typedef SHZ_ALIASING int64_t shz_alias_int64_t
 
typedef SHZ_ALIASING uint64_t shz_alias_uint64_t
 
typedef SHZ_ALIASING double shz_alias_double_t
 

Detailed Description

Preprocessor definitions and macro utilities.

This file contains commonly used preprocessor definitions used throughout the project:

  • Library-wide configuration defines
  • Compiler detection
  • Compiler attributes
  • TLS model
  • Conversion utilities
Author
2025, 2026 Falco Girgis

Definition in file shz_cdefs.h.

Macro Definition Documentation

◆ SHZ_SH4

#define SHZ_SH4

Back-end for the Dreamcast's SH4.

Definition at line 30 of file shz_cdefs.h.

◆ SHZ_PPC

#define SHZ_PPC

Back-end for the Gamecube/Wii's Gekko PPC.

Definition at line 31 of file shz_cdefs.h.

◆ SHZ_MIPS

#define SHZ_MIPS

Back-end for MIPS architectures.

Definition at line 32 of file shz_cdefs.h.

◆ SHZ_ARM

#define SHZ_ARM

Back-end for ARM architectures.

Definition at line 33 of file shz_cdefs.h.

◆ SHZ_X86

#define SHZ_X86

Back-end for x86/64 architectures.

Definition at line 34 of file shz_cdefs.h.

◆ SHZ_WASM

#define SHZ_WASM

Back-end for WebAssembly.

Definition at line 35 of file shz_cdefs.h.

◆ SHZ_SW

#define SHZ_SW

Generic C-based software back-end.

Definition at line 36 of file shz_cdefs.h.

◆ SHZ_BACKEND

#define SHZ_BACKEND

Definition at line 44 of file shz_cdefs.h.

◆ SHZ_TLS_DISABLED

#define SHZ_TLS_DISABLED

No thread-local variables.

Definition at line 52 of file shz_cdefs.h.

◆ SHZ_TLS_IMPLICIT

#define SHZ_TLS_IMPLICIT

Use thread_local keyword for TLS.

Definition at line 53 of file shz_cdefs.h.

◆ SHZ_TLS_PTHREAD

#define SHZ_TLS_PTHREAD

Use pthread unique keys for TLS.

Definition at line 54 of file shz_cdefs.h.

◆ SHZ_TLS_CTHREAD

#define SHZ_TLS_CTHREAD

Use C11 thread TSS keys for TLS.

Definition at line 55 of file shz_cdefs.h.

◆ SHZ_TLS_MODEL

#define SHZ_TLS_MODEL

Definition at line 61 of file shz_cdefs.h.

◆ SHZ_GNUC

#define SHZ_GNUC

Definition at line 85 of file shz_cdefs.h.

◆ SHZ_STRINGIFY_LITERAL

#define SHZ_STRINGIFY_LITERAL ( a)

Stringifies a literal expression.

Definition at line 94 of file shz_cdefs.h.

◆ SHZ_STRINGIFY

#define SHZ_STRINGIFY ( a)

Stringifies an expression after preprocessing, supporting macro expansion.

Definition at line 96 of file shz_cdefs.h.

◆ SHZ_COUNT_OF

#define SHZ_COUNT_OF ( array)

Returns the number of elements within a statically sized array.

Definition at line 98 of file shz_cdefs.h.

◆ SHZ_CONTAINER_OF

#define SHZ_CONTAINER_OF ( ptr,
type,
member )

Returns the containing structure from a pointer to one of its members.

Definition at line 100 of file shz_cdefs.h.

◆ SHZ_SWAP

#define SHZ_SWAP ( a,
b )

Macro which swaps the two values held by a and b.

Definition at line 102 of file shz_cdefs.h.

◆ SHZ_DECLARE_STRUCT

#define SHZ_DECLARE_STRUCT ( n,
t )

Macro which forward declares a struct and its typedef.

Definition at line 104 of file shz_cdefs.h.

◆ SHZ_DECLARE_STRUCT_ALIGNED

#define SHZ_DECLARE_STRUCT_ALIGNED ( n,
t,
a )

Macro which forward declares a manually aligned struct and its typedef.

Definition at line 106 of file shz_cdefs.h.

◆ SHZ_TLS_DECL

#define SHZ_TLS_DECL ( type,
name,
... )

Declares a TLS variable with disabled model (so not thread-local).

Definition at line 266 of file shz_cdefs.h.

◆ SHZ_TLS_REF

#define SHZ_TLS_REF ( name)

References a TLS variable, with disabled model.

Definition at line 268 of file shz_cdefs.h.

Typedef Documentation

◆ shz_alias_int16_t

typedef SHZ_ALIASING int16_t shz_alias_int16_t

int16_t type whose value may be aliased as another type.

Definition at line 336 of file shz_cdefs.h.

◆ shz_alias_uint16_t

typedef SHZ_ALIASING uint16_t shz_alias_uint16_t

uint16_t type whose value may be aliased as another type.

Definition at line 338 of file shz_cdefs.h.

◆ shz_alias_int32_t

typedef SHZ_ALIASING int32_t shz_alias_int32_t

int32_t type whose value may be aliased as another type.

Definition at line 340 of file shz_cdefs.h.

◆ shz_alias_uint32_t

typedef SHZ_ALIASING uint32_t shz_alias_uint32_t

uint32_t type whose value may be aliased as another type.

Definition at line 342 of file shz_cdefs.h.

◆ shz_alias_float_t

typedef SHZ_ALIASING float shz_alias_float_t

float type whose value may be aliased as another type.

Definition at line 344 of file shz_cdefs.h.

◆ shz_alias_int64_t

typedef SHZ_ALIASING int64_t shz_alias_int64_t

int64_t type whose value may be aliased as another type.

Definition at line 346 of file shz_cdefs.h.

◆ shz_alias_uint64_t

typedef SHZ_ALIASING uint64_t shz_alias_uint64_t

uint64_t type whose value may be aliased as another type.

Definition at line 348 of file shz_cdefs.h.

◆ shz_alias_double_t

typedef SHZ_ALIASING double shz_alias_double_t

double type whose value may be aliased as another type.

Definition at line 350 of file shz_cdefs.h.