commit cd697484ae8b6cd0a3fcc3f808543df606d7004c
parent a7331ba4e37b47fd0a5edd663fee5e788332386a
Author: robert <robertrussell.72001@gmail.com>
Date: Tue, 12 Jul 2022 16:35:08 -0700
Prevent warning from int128 usage
Diffstat:
2 files changed, 9 insertions(+), 16 deletions(-)
diff --git a/Makefile b/Makefile
@@ -3,10 +3,10 @@
include config.mk
SRC =\
- src/alloc.c\
- src/log.c\
- src/opt.c\
- src/utf8.c
+ src/alloc.c\
+ src/log.c\
+ src/opt.c\
+ src/utf8.c
libcext.a: $(SRC:.c=.o)
$(AR) -rcs $@ $(SRC:.c=.o)
@@ -14,15 +14,10 @@ libcext.a: $(SRC:.c=.o)
.c.o:
$(CC) -c -o $@ $(CFLAGS) $<
-src/alloc.o: src/alloc.c inc/cext/cext.h inc/cext/alloc.h inc/cext/log.h config.mk
-src/log.o: src/log.c inc/cext/cext.h inc/cext/log.h config.mk
-src/opt.o: src/opt.c inc/cext/cext.h inc/cext/opt.h config.mk
-src/utf8.o: src/utf8.c inc/cext/cext.h inc/cext/utf8.h config.mk
-
-inc/cext/alloc.h: inc/cext/def.h
-inc/cext/cext.h: inc/cext/def.h
-inc/cext/utf8.h: inc/cext/def.h
-inc/cext/vec.h: inc/cext/alloc.h inc/cext/def.h
+src/alloc.o: src/alloc.c inc/cext/cext.h inc/cext/def.h inc/cext/alloc.h inc/cext/log.h config.mk
+src/log.o: src/log.c inc/cext/cext.h inc/cext/def.h inc/cext/log.h config.mk
+src/opt.o: src/opt.c inc/cext/cext.h inc/cext/def.h inc/cext/opt.h config.mk
+src/utf8.o: src/utf8.c inc/cext/cext.h inc/cext/def.h inc/cext/utf8.h config.mk
clean:
rm -f libcext.a $(SRC:.c=.o)
diff --git a/inc/cext/def.h b/inc/cext/def.h
@@ -74,8 +74,7 @@ typedef uintptr_t uptr;
#define USIZE_MAX SIZE_MAX
typedef size_t usize;
-#ifndef __STRICT_ANSI__
-#ifdef __SIZEOF_INT128__
+#if !defined(__STRICT_ANSI__) && defined(__SIZEOF_INT128__)
#define CEXT_HAVE_128 1
#define I128_MIN ((i128)-1 - I128_MAX)
@@ -86,7 +85,6 @@ typedef __int128 i128;
typedef unsigned __int128 u128;
#endif
-#endif
#define RUNE_BAD RUNE_C(0xFFFD)
#define RUNE_MAX RUNE_C(0x10FFFF)