diff --git a/code/locale.c b/code/locale.c index 3094585..a294b01 100644 --- a/code/locale.c +++ b/code/locale.c @@ -2,14 +2,16 @@ // TODO: X-macros // TODO: data race possible (see 7.11.1.1 p. 5) // TODO: something about restoring locales (see 7.11.1.1 p. 8) - -#include +#include +#include +#include +#include #define _LC_FIRST 0 #define _LC_LAST 5 static struct lconv _locale; -static char *_locale_str; +static const char *_locale_str; char *setlocale(int category, const char *locale) { diff --git a/inc/_platform.h b/inc/_platform.h index d5b5b86..208cf68 100644 --- a/inc/_platform.h +++ b/inc/_platform.h @@ -7,8 +7,6 @@ #define __STDC_WANT_LIB_EXT1__ 1 #endif -#ifdef - // Compiler Identification #if defined(_MSC_VER) && !defined(__clang__) @@ -60,6 +58,4 @@ #ifdef __STDC_WANT_LIB_EXT1__ typedef int errno_t; typedef size_t rsize_t; -#endif - #endif \ No newline at end of file diff --git a/makefile b/makefile index 74d0193..833f0d3 100644 --- a/makefile +++ b/makefile @@ -1,6 +1,6 @@ -GNUFLAGS=-Iinc -Icode -CLFLAGS=/link /incremental:no /subsystem:windows /nodefaultlib kernel32.lib +GNUFLAGS=-Werror -Wall -Iinc -Icode +CLFLAGS=/I:inc /link /incremental:no /subsystem:windows /nodefaultlib kernel32.lib CC=clang CFLAGS=$(GNUFLAGS) @@ -9,12 +9,12 @@ LDFLAGS=/nologo /nodefaultlib /entry:mainCRTStartup SRC_DIR := code OBJ_DIR := build SRC_FILES := $(wildcard $(SRC_DIR)/*.c) -OBJ_FILES := $(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.o,$(SRC_FILES)) +OBJ_FILES := $(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.obj,$(SRC_FILES)) ciabatta.lib: $(OBJ_FILES) - lib $(LDFLAGS) /out:lib/$@ $^ + lib $(LDFLAGS) /out:$@ $^ -$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c +$(OBJ_DIR)/%.obj: $(SRC_DIR)/%.c $(CC) $(CFLAGS) -c -o $@ $< .PHONY: ciabatta.lib diff --git a/test/bake.bat b/test/bake.bat index eedb7f7..3f407e7 100644 --- a/test/bake.bat +++ b/test/bake.bat @@ -9,7 +9,7 @@ del temp cl /Z7 /X /c /I ..\inc %includes% /nologo /GS- /Gm- /GR- /EHa- /Oi /W4 test.c ::clang -c -Wall test.c -otest1.obj -link /nologo test.obj /nodefaultlib user32.lib kernel32.lib ..\lib\ciabatta.lib -subsystem:console +link /nologo test.obj /nodefaultlib user32.lib kernel32.lib ..\ciabatta.lib -subsystem:console ::link /nologo test1.obj /nodefaultlib user32.lib kernel32.lib ..\lib\ciabatta.lib -subsystem:console -popd \ No newline at end of file +popd diff --git a/test/inctoarg.c b/test/inctoarg.c index 07f3926..af9382e 100644 --- a/test/inctoarg.c +++ b/test/inctoarg.c @@ -8,8 +8,12 @@ int main() while(*include != 0) { printf("-I \""); while(*include != ';' && *include != 0) { - printf("%c", *include); - *include ++; + if (*include == '\\') { + printf("/"); + } else { + printf("%c", *include); + } + *include++; } if(*include == ';') { ++include;