aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-09-15 13:34:07 +0900
committernsfisis <nsfisis@gmail.com>2025-09-15 13:34:07 +0900
commitedb1612b9f5d5485528e24470b88a7d602772ad6 (patch)
tree2bca7625a11bb59a2abb860e8b73fc43f6e1987b /src
parent6994805cd5cbb17ae4ff5513ec776bb08eddec6c (diff)
downloadducc-edb1612b9f5d5485528e24470b88a7d602772ad6.tar.gz
ducc-edb1612b9f5d5485528e24470b88a7d602772ad6.tar.zst
ducc-edb1612b9f5d5485528e24470b88a7d602772ad6.zip
refactor: remove src/std.h
Diffstat (limited to 'src')
-rw-r--r--src/ast.h2
-rw-r--r--src/cli.c4
-rw-r--r--src/cli.h1
-rw-r--r--src/common.h2
-rw-r--r--src/fs.c1
-rw-r--r--src/io.h1
-rw-r--r--src/json.h2
-rw-r--r--src/main.c1
-rw-r--r--src/std.h9
-rw-r--r--src/sys.c8
-rw-r--r--src/token.h1
11 files changed, 6 insertions, 26 deletions
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 <stddef.h>
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 <stddef.h>
_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 <stdlib.h>
#include <string.h>
-#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 <stddef.h>
-
-// TODO: <stdlib.h>
-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 <libgen.h>
#include <linux/limits.h>
#include <stdlib.h>
-#include "std.h"
-
-// TODO: #inclue some header.
-#ifndef __ducc__
-typedef long ssize_t;
-#endif
-ssize_t readlink(const char*, char*, size_t);
+#include <unistd.h>
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 <stddef.h>
#include "io.h"
#include "json.h"