Skip to content

Instantly share code, notes, and snippets.

@gszauer
Created May 26, 2022 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gszauer/624a7ff8eb8595fa015c62bedebd4351 to your computer and use it in GitHub Desktop.
Save gszauer/624a7ff8eb8595fa015c62bedebd4351 to your computer and use it in GitHub Desktop.
types.h
#pragma once
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef unsigned long long u64;
typedef __int8 i8;
typedef __int16 i16;
typedef __int32 i32;
typedef __int64 i64;
typedef float f32;
typedef double f64;
static_assert (sizeof(u8) == 1, "Size is not correct");
static_assert (sizeof(u16) == 2, "Size is not correct");
static_assert (sizeof(u32) == 4, "Size is not correct");
static_assert (sizeof(u64) == 8, "Size is not correct");
static_assert (sizeof(i8) == 1, "Size is not correct");
static_assert (sizeof(i16) == 2, "Size is not correct");
static_assert (sizeof(i32) == 4, "Size is not correct");
static_assert (sizeof(i64) == 8, "Size is not correct");
static_assert (sizeof(f32) == 4, "Size is not correct");
static_assert (sizeof(f64) == 8, "Size is not correct");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment