Upload files to "include/stdWullie/definitions"
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
// this code is licenced under Wrathmark licence
|
||||
// © 2026 wullie wulliestudio.com
|
||||
// please see attached licence for full usage and rights
|
||||
|
||||
//defined like stdint to avoid confilict
|
||||
#ifndef _STDINT_H
|
||||
#define _STDINT_H 1
|
||||
|
||||
// create the types for signed ints using base structures
|
||||
typedef signed char int8_t;
|
||||
typedef signed short int int16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef signed long long int int64_t;
|
||||
|
||||
// same as above but unsigned
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short int uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned long long int uint64_t;
|
||||
|
||||
// macros for long long, unsigned and unsigned long long
|
||||
#define U unsigned
|
||||
#define LL long long
|
||||
#define ULL unsigned long long
|
||||
|
||||
// int max values
|
||||
#define INT8_MAX ((int8_t)0x7F)
|
||||
#define INT16_MAX ((int16_t)0x7FFF)
|
||||
#define INT32_MAX ((int32_t)0xFFFFFFF)
|
||||
#define INT64_MAX ((int64_t)0xFFFFFFFFFFFFFFFLL)
|
||||
|
||||
// max values for uint's
|
||||
#define UINT8_MAX ((uint8_t)0xFF)
|
||||
#define UINT16_MAX ((uint16_t)0xFFFF)
|
||||
#define UINT32_MAX ((uint32_t)0xFFFFFFFFU)
|
||||
#define UINT64_MAX ((uint64_t)0xFFFFFFFFFFFFFFFFULL)
|
||||
|
||||
// min values for uint
|
||||
#define UINT8_MIN ((uint8_t)0)
|
||||
#define UINT16_MIN ((uint16_t)0)
|
||||
#define UINT32_MIN ((uint32_t)0)
|
||||
#define UINT64_MIN ((uint64_t)0)
|
||||
|
||||
//min values for int
|
||||
#define INT8_MIN ((int8_t)(-INT8_MAX - 1))
|
||||
#define INT16_MIN ((int16_t)(-INT16_MAX - 1))
|
||||
#define INT32_MIN ((int32_t)(-INT32_MAX - 1))
|
||||
#define INT64_MIN ((int64_t)(-INT64_MAX - 1))
|
||||
#endif
|
||||
@@ -0,0 +1,14 @@
|
||||
// this code is licenced under Wrathmark licence
|
||||
// © 2026 wullie wulliestudio.com
|
||||
// please see attached licence for full usage and rights
|
||||
|
||||
#ifndef TIMESPEC_H
|
||||
#define TIMESPEC_H
|
||||
|
||||
// storage for seconds and nano seconds
|
||||
typedef struct timespec{
|
||||
long tv_sec;
|
||||
long tv_nsec;
|
||||
}timespec;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,13 @@
|
||||
// this code is licenced under Wrathmark licence
|
||||
// © 2026 wullie wulliestudio.com
|
||||
// please see attached licence for full usage and rights
|
||||
|
||||
#ifndef TYPEBOOL_h
|
||||
#define TYPEBOOL_h
|
||||
|
||||
// just 3 lines but its cleaner here
|
||||
#define bool _Bool
|
||||
#define false 0
|
||||
#define true 1
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
// this code is licenced under Wrathmark licence
|
||||
// © 2026 wullie wulliestudio.com
|
||||
// please see attached licence for full usage and rights
|
||||
|
||||
#ifndef TYPENULL_h
|
||||
#define TYPENULL_h
|
||||
|
||||
// 2 line of gay shit maybe more if i do pointers
|
||||
#undef NULL
|
||||
#define NULL 0
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user