Remove reliance on system stdint.h header
This commit is contained in:
parent
6902b49be2
commit
a8594606c3
@ -1,5 +1,5 @@
|
|||||||
#if defined(__aarch64__)
|
#if defined(__aarch64__)
|
||||||
#include <stdint.h>
|
#include "../int.h"
|
||||||
|
|
||||||
void exit(int8_t status){
|
void exit(int8_t status){
|
||||||
asm ( "mov x0, %0\n" // Move the exit status into register x0
|
asm ( "mov x0, %0\n" // Move the exit status into register x0
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#if defined(__mips__)
|
#if defined(__mips__)
|
||||||
#include <stdint.h>
|
#include "../int.h"
|
||||||
|
|
||||||
void exit(int8_t status){
|
void exit(int8_t status){
|
||||||
asm (
|
asm (
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#include <stdint.h>
|
|
||||||
#if defined(__x86_64__)
|
#if defined(__x86_64__)
|
||||||
|
#include "../int.h"
|
||||||
|
|
||||||
#define SYS_EXIT 60
|
#define SYS_EXIT 60
|
||||||
void exit(int8_t status) {
|
void exit(int8_t status) {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include <stdint.h>
|
#include "int.h"
|
||||||
#include "sys.h"
|
#include "sys.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
23
int.h
Normal file
23
int.h
Normal 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
|
||||||
Loading…
x
Reference in New Issue
Block a user