From edb1612b9f5d5485528e24470b88a7d602772ad6 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 15 Sep 2025 13:34:07 +0900 Subject: refactor: remove src/std.h --- src/ast.h | 2 +- src/cli.c | 4 ++-- src/cli.h | 1 - src/common.h | 2 +- src/fs.c | 1 - src/io.h | 1 - src/json.h | 2 -- src/main.c | 1 - src/std.h | 9 --------- src/sys.c | 8 +------- src/token.h | 1 + 11 files changed, 6 insertions(+), 26 deletions(-) delete mode 100644 src/std.h (limited to 'src') diff --git a/src/ast.h b/src/ast.h index 8d40575..04cc1ec 100644 --- a/src/ast.h +++ b/src/ast.h @@ -1,7 +1,7 @@ #ifndef DUCC_AST_H #define DUCC_AST_H -#include "std.h" +#include typedef enum { StorageClass_unspecified, diff --git a/src/cli.c b/src/cli.c index de30033..5448d3f 100644 --- a/src/cli.c +++ b/src/cli.c @@ -60,8 +60,8 @@ CliArgs* parse_cli_args(int argc, char** argv) { } else if (strcmp(argv[i], "--version") == 0) { print_version(); exit(0); - } else if (strcmp(argv[i], "--std=c23") == 0) { - // ignore --std=c23 + } else if (strcmp(argv[i], "--std=gnu23") == 0) { + // ignore --std=gnu23 } else { fatal_error("unknown option: %s", argv[i]); } diff --git a/src/cli.h b/src/cli.h index 51263e2..f52964c 100644 --- a/src/cli.h +++ b/src/cli.h @@ -2,7 +2,6 @@ #define DUCC_CLI_H #include "common.h" -#include "std.h" typedef struct { const char* input_filename; diff --git a/src/common.h b/src/common.h index aea11d0..94f75b1 100644 --- a/src/common.h +++ b/src/common.h @@ -1,7 +1,7 @@ #ifndef DUCC_COMMON_H #define DUCC_COMMON_H -#include "std.h" +#include _Noreturn void fatal_error(const char* msg, ...); diff --git a/src/fs.c b/src/fs.c index 67d808e..c702fa4 100644 --- a/src/fs.c +++ b/src/fs.c @@ -1,7 +1,6 @@ #include "fs.h" #include #include -#include "std.h" // 'ext' must include '.'. char* replace_extension(const char* file_name, const char* ext) { diff --git a/src/io.h b/src/io.h index 604b8f6..67bf055 100644 --- a/src/io.h +++ b/src/io.h @@ -2,7 +2,6 @@ #define DUCC_IO_H #include "json.h" -#include "std.h" typedef struct { const char* filename; diff --git a/src/json.h b/src/json.h index 40d5cde..9322901 100644 --- a/src/json.h +++ b/src/json.h @@ -1,8 +1,6 @@ #ifndef DUCC_JSON_H #define DUCC_JSON_H -#include "std.h" - struct JsonBuilder; typedef struct JsonBuilder JsonBuilder; diff --git a/src/main.c b/src/main.c index a72b4f0..57b542c 100644 --- a/src/main.c +++ b/src/main.c @@ -8,7 +8,6 @@ #include "io.h" #include "parse.h" #include "preprocess.h" -#include "std.h" #include "tokenize.h" int main(int argc, char** argv) { diff --git a/src/std.h b/src/std.h deleted file mode 100644 index bfa5f0a..0000000 --- a/src/std.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef DUCC_STD_H -#define DUCC_STD_H - -#include - -// TODO: -int mkstemps(char*, int); - -#endif diff --git a/src/sys.c b/src/sys.c index 8d89524..ba946a1 100644 --- a/src/sys.c +++ b/src/sys.c @@ -2,13 +2,7 @@ #include #include #include -#include "std.h" - -// TODO: #inclue some header. -#ifndef __ducc__ -typedef long ssize_t; -#endif -ssize_t readlink(const char*, char*, size_t); +#include static char* get_self_path() { char* buf = calloc(PATH_MAX, sizeof(char)); diff --git a/src/token.h b/src/token.h index bbd8066..ced3de3 100644 --- a/src/token.h +++ b/src/token.h @@ -1,6 +1,7 @@ #ifndef DUCC_TOKEN_H #define DUCC_TOKEN_H +#include #include "io.h" #include "json.h" -- cgit v1.2.3-70-g09d2