Remove reliance on system stdint.h header

This commit is contained in:
Lucas Schumacher 2025-04-14 17:47:58 -04:00
parent 6902b49be2
commit a8594606c3
6 changed files with 28 additions and 5 deletions

View File

@ -1,5 +1,5 @@
#if defined(__aarch64__)
#include <stdint.h>
#include "../int.h"
void exit(int8_t status){
asm ( "mov x0, %0\n" // Move the exit status into register x0

View File

@ -1,5 +1,5 @@
#if defined(__mips__)
#include <stdint.h>
#include "../int.h"
void exit(int8_t status){
asm (

View File

@ -1,5 +1,5 @@
#include <stdint.h>
#if defined(__x86_64__)
#include "../int.h"
#define SYS_EXIT 60
void exit(int8_t status) {

View File

@ -1,4 +1,4 @@
#include <stdint.h>
#include "int.h"
#include "sys.h"

23
int.h Normal file
View File

@ -0,0 +1,23 @@
#if defined(__x86_64__) || defined(__aarch64__)
#define __WORDSIZE 64
#elif defined(__mips__)
#define __WORDSIZE 32
#endif
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long uint64_t;
typedef char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef long int64_t;
#if __WORDSIZE == 64
typedef long intptr_t;
typedef unsigned long uintptr_t;
#elif __WORDSIZE == 32
typedef int intptr_t;
typedef unsigned int uintptr_t;
#endif

2
sys.h
View File

@ -1,5 +1,5 @@
#ifndef MINIMALSYS_H
#include <stdint.h>
#include "int.h"
void exit(int8_t status);