// vim:fileencoding=utf-8:foldmethod=marker

#ifndef ALIASES_H
#define ALIASES_H

#include "../platform/platform.h"
#include <stdint.h>

#if defined(WAPP_PLATFORM_C) && WAPP_PLATFORM_C_VERSION >= WAPP_PLATFORM_C11_VERSION && !defined(WAPP_PLATFORM_APPLE)
  #include <uchar.h>

  #if WAPP_PLATFORM_C_VERSION >= WAPP_PLATFORM_C23_VERSION
    #define c8 char8_t
  #else
    #define c8 uint8_t
  #endif // !WAPP_PLATFORM_C23_VERSION

  #define c16 char16_t
  #define c32 char32_t
#else
  #define c8 uint8_t
  #define c16 uint16_t
  #define c32 uint32_t
#endif // !WAPP_PLATFORM_C

#define u8 uint8_t
#define u16 uint16_t
#define u32 uint32_t
#define u64 uint64_t

#define b8 uint8_t

#ifndef WAPP_PLATFORM_CPP

#ifndef false
#define false (b8)0
#endif // !false

#ifndef true
#define true (b8)1
#endif // !true

#endif // !WAPP_PLATFORM_CPP

#define i8 int8_t
#define i16 int16_t
#define i32 int32_t
#define i64 int64_t

#define f32 float
#define f64 double
#define f128 long double

#define uptr uintptr_t
#define iptr intptr_t

#define wapp_extern extern
#define wapp_intern static
#define wapp_persist static

#ifdef WAPP_PLATFORM_CPP
#define wapp_class_mem static
#define BEGIN_C_LINKAGE extern "C" {
#define END_C_LINKAGE }
#endif // WAPP_PLATFORM_CPP

#endif // !ALIASES_H
