types -> prick_aliases

This commit is contained in:
2025-11-17 00:52:44 +00:00
parent 50bd444d7e
commit cb583d0277

View File

@@ -1,20 +1,17 @@
/* Copyright (C) 2025 Aryadev Chavali
* 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 Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
/* prick_aliases.h:
* Created: 2025-04-09
* Description: Some basic type definitions to make life easier.
* Author: Aryadev Chavali
* License: See end of file
* Commentary:
This library defines some useful aliases for common types. These are mostly
handpicked, and aren't necessary.
*/
#ifndef TYPES_H
#define TYPES_H
#ifndef PRICK_ALIASES_H
#define PRICK_ALIASES_H
#include <assert.h>
#include <stdint.h>
typedef uint8_t u8;
@@ -27,4 +24,21 @@ typedef int16_t i16;
typedef int32_t i32;
typedef int64_t i64;
static_assert(sizeof(float) == 4, "f32 requires 4 byte floats");
static_assert(sizeof(double) == 8, "f64 requires 8 byte doubles");
typedef float f32;
typedef double f64;
#endif
/* Copyright (C) 2025 Aryadev Chavali
* 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 Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
*/