commit 1a258ff55b11f1d845b62ae5d329d346e38aef56
parent 77dc5f628510a0e92aa75a3ffb674b9089b62894
Author: Chris Bracken <chris@bracken.jp>
Date: Wed, 11 Feb 2026 19:13:33 +0900
Fix gout_config: use configs instead of public_configs
Previously, these weren't being picked up at all!
Diffstat:
7 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/BUILD.gn b/BUILD.gn
@@ -7,19 +7,21 @@ config("gout_config") {
"_BSD_SOURCE",
]
libs = [ "git2" ]
- public_configs = [
+ configs = [
"//build:compiler_std",
"//build:compiler_warnings",
"//build:strict_prototypes",
+ "//build:no_exceptions",
+ "//build:no_rtti",
]
if (is_debug) {
- public_configs += [
+ configs += [
"//build:debug",
"//build:no_optimize",
"//build:symbols",
]
} else {
- public_configs += [
+ configs += [
"//build:release",
"//build:optimize_size",
"//build:lto",
diff --git a/build/BUILD.gn b/build/BUILD.gn
@@ -54,6 +54,18 @@ config("lto") {
ldflags = [ "-flto" ]
}
+# Disable exceptions.
+config("no_exceptions") {
+ cflags = [ "-fno-exceptions" ]
+ ldflags = [ "-fno-exceptions" ]
+}
+
+# Disable runttime type information.
+config("no_rtti") {
+ cflags = [ "-fno-rtti" ]
+ ldflags = [ "-fno-rtti" ]
+}
+
# Regular build with symbols.
config("symbols") {
cflags = [ "-g2" ]
diff --git a/src/writer/gopher/index_writer.c b/src/writer/gopher/index_writer.c
@@ -11,7 +11,7 @@ struct GopherIndexWriter {
GopherRepoIndex* index;
};
-GopherIndexWriter* gopher_indexwriter_create() {
+GopherIndexWriter* gopher_indexwriter_create(void) {
GopherIndexWriter* writer = ecalloc(1, sizeof(GopherIndexWriter));
FILE* out = stdout;
writer->index = gopher_repoindex_create(out);
diff --git a/src/writer/gopher/index_writer.h b/src/writer/gopher/index_writer.h
@@ -5,7 +5,7 @@
typedef struct GopherIndexWriter GopherIndexWriter;
-GopherIndexWriter* gopher_indexwriter_create();
+GopherIndexWriter* gopher_indexwriter_create(void);
void gopher_indexwriter_free(GopherIndexWriter* writer);
void gopher_indexwriter_begin(GopherIndexWriter* writer);
void gopher_indexwriter_add_repo(GopherIndexWriter* writer, GitRepo* repo);
diff --git a/src/writer/html/index_writer.c b/src/writer/html/index_writer.c
@@ -11,7 +11,7 @@ struct HtmlIndexWriter {
HtmlRepoIndex* index;
};
-HtmlIndexWriter* html_indexwriter_create() {
+HtmlIndexWriter* html_indexwriter_create(void) {
HtmlIndexWriter* writer = ecalloc(1, sizeof(HtmlIndexWriter));
FILE* out = stdout;
writer->index = html_repoindex_create(out);
diff --git a/src/writer/html/index_writer.h b/src/writer/html/index_writer.h
@@ -5,7 +5,7 @@
typedef struct HtmlIndexWriter HtmlIndexWriter;
-HtmlIndexWriter* html_indexwriter_create();
+HtmlIndexWriter* html_indexwriter_create(void);
void html_indexwriter_free(HtmlIndexWriter* writer);
void html_indexwriter_set_me_url(HtmlIndexWriter* writer, const char* url);
void html_indexwriter_begin(HtmlIndexWriter* writer);
diff --git a/src/writer/index_writer.c b/src/writer/index_writer.c
@@ -23,10 +23,10 @@ struct IndexWriter {
IndexWriterVoidFunc end;
};
-static IndexWriter* htmlindexwriter_create();
+static IndexWriter* htmlindexwriter_create(void);
static void htmlindexwriter_free(IndexWriter* writer);
-static IndexWriter* gopherindexwriter_create();
+static IndexWriter* gopherindexwriter_create(void);
static void gopherindexwriter_free(IndexWriter* writer);
IndexWriter* indexwriter_create(IndexWriterType type) {
@@ -72,7 +72,7 @@ void indexwriter_end(IndexWriter* writer) {
/* HtmlIndexWriter setup/teardown. */
-IndexWriter* htmlindexwriter_create() {
+IndexWriter* htmlindexwriter_create(void) {
IndexWriter* writer = ecalloc(1, sizeof(IndexWriter));
HtmlIndexWriter* html_writer = html_indexwriter_create();
writer->type = kIndexWriterTypeHtml;
@@ -95,7 +95,7 @@ void htmlindexwriter_free(IndexWriter* writer) {
/* GopherIndexWriter setup/teardown. */
-IndexWriter* gopherindexwriter_create() {
+IndexWriter* gopherindexwriter_create(void) {
IndexWriter* writer = ecalloc(1, sizeof(IndexWriter));
GopherIndexWriter* gopher_writer = gopher_indexwriter_create();
writer->type = kIndexWriterTypeGopher;