Update M2libc and clear out some unneeded globals

This commit is contained in:
Jeremiah Orians 2021-11-22 06:07:44 -05:00
parent d6d869f2c0
commit 892a40aa1a
No known key found for this signature in database
GPG Key ID: 6B3A3F198708F894
5 changed files with 4 additions and 45 deletions

2
M2libc

@ -1 +1 @@
Subproject commit 818fcfb333d73fbe0293b97b769718f0945e22dc
Subproject commit daec5ae864c80535dac5d53f83c8718e677b9e2d

20
cc.h
View File

@ -20,25 +20,9 @@
#include <stdio.h>
#include <string.h>
// CONSTANT FALSE 0
#define FALSE 0
// CONSTANT TRUE 1
#define TRUE 1
// CONSTANT KNIGHT_NATIVE 0
#define KNIGHT_NATIVE 0
// CONSTANT KNIGHT_POSIX 1
#define KNIGHT_POSIX 1
// CONSTANT X86 2
#define X86 2
// CONSTANT AMD64 3
#define AMD64 3
// CONSTANT ARMV7L 4
#define ARMV7L 4
// CONSTANT AARCH64 5
#define AARCH64 5
// CONSTANT RISCV64 6
#define RISCV64 6
#define FALSE 0
#define TRUE 1
int in_set(int c, char* s);

View File

@ -41,31 +41,24 @@ void setup_env()
if(NULL != hold) ARCH = hold;
/* Set desired architecture */
if(match("knight-native", ARCH)) Architecture = KNIGHT_NATIVE;
else if(match("knight-posix", ARCH)) Architecture = KNIGHT_POSIX;
else if(match("x86", ARCH))
if(match("x86", ARCH))
{
Architecture = X86;
init_macro_env("__i386__", "1", "--architecture", 0);
}
else if(match("amd64", ARCH))
{
Architecture = AMD64;
init_macro_env("__x86_64__", "1", "--architecture", 0);
}
else if(match("armv7l", ARCH))
{
Architecture = ARMV7L;
init_macro_env("__arm__", "1", "--architecture", 0);
}
else if(match("aarch64", ARCH))
{
Architecture = AARCH64;
init_macro_env("__aarch64__", "1", "--architecture", 0);
}
else if(match("riscv64", ARCH))
{
Architecture = RISCV64;
init_macro_env("__riscv", "1", "--architecture", 0);
init_macro_env("__riscv_xlen", "64", "--architecture", 1);
}

View File

@ -32,15 +32,7 @@ struct token_list* globals_list;
char* hold_string;
int string_index;
/* Our Target Architecture */
int Architecture;
int register_size;
int MAX_STRING;
struct type* integer;
/* enable bootstrap-mode */
int BOOTSTRAP_MODE;
/* enable preprocessor-only mode */
int PREPROCESSOR_MODE;

View File

@ -32,19 +32,9 @@ extern struct token_list* globals_list;
extern char* hold_string;
extern int string_index;
/* Our Target Architecture */
extern int Architecture;
extern int register_size;
/* Allow us to have a single settable max string */
extern int MAX_STRING;
/* make default type integer */
extern struct type* integer;
/* enable bootstrap-mode */
extern int BOOTSTRAP_MODE;
/* enable preprocessor-only mode */
extern int PREPROCESSOR_MODE;