Skip to content

Instantly share code, notes, and snippets.

@marvhus
Last active March 28, 2023 10:46
Show Gist options
  • Save marvhus/ad910cd5fec4381c741155eabc38ef62 to your computer and use it in GitHub Desktop.
Save marvhus/ad910cd5fec4381c741155eabc38ef62 to your computer and use it in GitHub Desktop.
C header file for some typedef stuff.
/*
types.h - a header file for Rust/Jai like types in C.
Copyright (C) 2023 marvhus
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _TYPES_H_
#define _TYPES_H_
typedef signed char s8; // 8 bits
typedef unsigned char u8; // ^^^^^^
typedef signed short s16; // 16 bits
typedef unsigned short u16; // ^^^^^^^
typedef signed int s32; // 32 bits, (16 bits if on a 32 bit OS)
typedef unsigned int u32; // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
typedef signed long s64; // 64 bits, (32 bits if on a 32 bit OS)
typedef unsigned long u64; // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
typedef float f32;
typedef double f64;
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment