From b0240c49114a940653d0d48cad6cdf100b5fabb8 Mon Sep 17 00:00:00 2001 From: AnnaSnoeijs Date: Fri, 15 Aug 2025 19:20:04 +0200 Subject: [PATCH] Made code (mostly) follow C99 --- connect4.c | 8 ++++++-- makefile | 2 +- types.h | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/connect4.c b/connect4.c index 818ee72..8b99b57 100644 --- a/connect4.c +++ b/connect4.c @@ -30,7 +30,7 @@ #include "types.h" #include "ui.h" -#define VERSION 0.3.0 +#define VERSION 0.3.1 #ifndef GITHASH #define FULLVERSION VERSION @@ -48,7 +48,11 @@ extern char _binary_LICENSE_start[]; extern char _binary_LICENSE_end[]; #endif /* ! NO_OPTIONS */ -int main( [[maybe_unused]] int argc, [[maybe_unused]] char *argv[] ){ +int main( +#ifndef NO_OPTIONS // [[maybe_unused]] is unsupported in C99, so this will do + int argc, char *argv[] +#endif /* ! NO_OPTIONS */ +){ // Initialise variables board_t playboard = { .player = 0, diff --git a/makefile b/makefile index add7d4b..5d16aaa 100644 --- a/makefile +++ b/makefile @@ -7,7 +7,7 @@ ARCH = native O = s # Flags for the compiler -FLAGS = -std=c23 +FLAGS = -std=gnu99 FLAGS += -O$(O) FLAGS += -march=$(ARCH) # Only override gcc default tuning if specified in make command line diff --git a/types.h b/types.h index 9590065..374c136 100644 --- a/types.h +++ b/types.h @@ -2,6 +2,7 @@ #pragma once #include +#include #include #include "config.h"