G

G Programming Language
git clone http://git.omkov.net/G
Log | Tree | Refs | README | Download

AuthorJakob Wakeling <[email protected]>
Date2022-03-06 02:07:42
Commitedaa8c5f624a9ffe0feb37db7b2521e6fca75ac8
Parent281158b5eb9c03f2c32dfc6d4342720a0bd750b7

util: Update libutil headers

Diffstat

M src/util/alloc.c | 3 +--
M src/util/alloc.h | 11 ++++++++++-
M src/util/error.c | 4 +---
M src/util/error.h | 11 ++++++++++-
M src/util/fnv.c | 4 +---
M src/util/fnv.h | 13 ++++++++++---
M src/util/map.c | 3 +--
M src/util/map.h | 12 ++++++++++--
M src/util/optget.c | 4 +---
M src/util/optget.h | 14 ++++++++++----
M src/util/util.h | 11 +++++++++--

11 files changed, 64 insertions, 26 deletions

diff --git a/src/util/alloc.c b/src/util/alloc.c
index ce7da7d..f8d1782 100644
--- a/src/util/alloc.c
+++ b/src/util/alloc.c
@@ -1,10 +1,8 @@
-// util/alloc.h, version 1.0.0
+// util/alloc.h, version 1.0.1
 // Memory allocation source file from libutil
 // Copyright (C) 2021, Jakob Wakeling
 // All rights reserved.
 
-
-
 #include "alloc.h"
 #include "error.h"
 
diff --git a/src/util/alloc.h b/src/util/alloc.h
index ad112cc..2d56976 100644
--- a/src/util/alloc.h
+++ b/src/util/alloc.h
@@ -1,17 +1,23 @@
-// util/alloc.h, version 1.0.0
+// util/alloc.h, version 1.0.1
 // Memory allocation header file from libutil
 // Copyright (C) 2021, Jakob Wakeling
 // All rights reserved.
 
-
-
 #ifndef UTIL_ALLOC_H_M0UWQ8LT
 #define UTIL_ALLOC_H_M0UWQ8LT
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "util.h"
 
 extern void *xmalloc(UINT l);
 extern void *xcalloc(UINT n, UINT l);
 extern void *xrealloc(void *p, UINT l);
 
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
 #endif // UTIL_ALLOC_H_M0UWQ8LT
diff --git a/src/util/error.c b/src/util/error.c
index dd43fb0..b043b01 100644
--- a/src/util/error.c
+++ b/src/util/error.c
@@ -1,10 +1,8 @@
-// util/error.h, version 1.1.1
+// util/error.h, version 1.1.2
 // Error source file from libutil
 // Copyright (C) 2020, Jakob Wakeling
 // All rights reserved.
 
-
-
 #include "error.h"
 
 #include <errno.h>
diff --git a/src/util/error.h b/src/util/error.h
index 5c61fac..8532283 100644
--- a/src/util/error.h
+++ b/src/util/error.h
@@ -1,13 +1,15 @@
-// util/error.h, version 1.1.1
+// util/error.h, version 1.1.2
 // Error header file from libutil
 // Copyright (C) 2020, Jakob Wakeling
 // All rights reserved.
 
-
-
 #ifndef UTIL_ERROR_H_38W06M3W
 #define UTIL_ERROR_H_38W06M3W
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <errno.h>
 #include <stdbool.h>
 #include <stdnoreturn.h>
@@ -59,4 +61,8 @@ extern void alert(const char *format, ...);
 /* Shorthand for strerror(errno). DEPRECIATED, use the SERR macro. */
 extern char *serr(void);
 
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
 #endif // UTIL_ERROR_H_38W06M3W
diff --git a/src/util/fnv.c b/src/util/fnv.c
index 1e95935..b74a7ed 100644
--- a/src/util/fnv.c
+++ b/src/util/fnv.c
@@ -1,10 +1,8 @@
-// util/fnv.c, version 1.0.1
+// util/fnv.c, version 1.0.2
 // FNV hash source file from libutil
 // Copyright (C) 2021, Jakob Wakeling
 // All rights reserved.
 
-
-
 #include "fnv.h"
 #include "util.h"
 
diff --git a/src/util/fnv.h b/src/util/fnv.h
index 24de21b..fb769a7 100644
--- a/src/util/fnv.h
+++ b/src/util/fnv.h
@@ -1,13 +1,15 @@
-// util/fnv.h, version 1.0.1
+// util/fnv.h, version 1.0.2
 // FNV hash header file from libutil
 // Copyright (C) 2021, Jakob Wakeling
 // All rights reserved.
 
-
-
 #ifndef UTIL_FNV_H_O4TYU6Q1
 #define UTIL_FNV_H_O4TYU6Q1
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "util.h"
 
 extern u32 fnv1a32(const char *dat, UINT len);
@@ -19,4 +21,8 @@ extern void fnv1a32_hash(u32 *ctx, char *dat, UINT len);
 extern void fnv1a64_init(u64 *ctx);
 extern void fnv1a64_hash(u64 *ctx, char *dat, UINT len);
 
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
 #endif // UTIL_FNV_H_O4TYU6Q1
diff --git a/src/util/map.c b/src/util/map.c
index 8d8e8f3..b40ae63 100644
--- a/src/util/map.c
+++ b/src/util/map.c
@@ -1,10 +1,8 @@
-// util/map.c, version 0.1.1
+// util/map.c, version 0.1.2
 // Map utility source file from libutil
 // Copyright (C) 2021, Jakob Wakeling
 // All rights reserved.
 
-
-
 /*
 	This file uses the currently non-standard 'typeof' operator. Its use is
 	considered acceptable because it is supported by both GCC and Clang, and
diff --git a/src/util/map.h b/src/util/map.h
index 153b470..d840b21 100644
--- a/src/util/map.h
+++ b/src/util/map.h
@@ -1,13 +1,15 @@
-// util/map.h, version 0.1.1
+// util/map.h, version 0.1.2
 // Map utility header file from libutil
 // Copyright (C) 2021, Jakob Wakeling
 // All rights reserved.
 
-
-
 #ifndef UTIL_MAP_H_NB53CJJ8
 #define UTIL_MAP_H_NB53CJJ8
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "util.h"
 
 typedef struct {
@@ -31,4 +33,8 @@ extern void *map_remove(map *m, char *k);
 extern void map_print(map *m);
 extern void map_debug(map *m);
 
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
 #endif // UTIL_MAP_H_NB53CJJ8
diff --git a/src/util/optget.c b/src/util/optget.c
index e324e73..b088fe0 100644
--- a/src/util/optget.c
+++ b/src/util/optget.c
@@ -1,10 +1,8 @@
-// util/optget.h, version 1.6.1
+// util/optget.h, version 1.6.2
 // optget source file from libutil
 // Copyright (C) 2020, Jakob Wakeling
 // All rights reserved.
 
-
-
 #include "error.h"
 #include "optget.h"
 
diff --git a/src/util/optget.h b/src/util/optget.h
index 79761f9..3faf2e0 100644
--- a/src/util/optget.h
+++ b/src/util/optget.h
@@ -1,13 +1,15 @@
-// util/optget.h, version 1.6.1
+// util/optget.h, version 1.6.2
 // optget header file from libutil
 // Copyright (C) 2020, Jakob Wakeling
 // All rights reserved.
 
-
-
 #ifndef UTIL_OPTGET_H_W3LIZK1S
 #define UTIL_OPTGET_H_W3LIZK1S
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define ARG_NUL 0
 #define ARG_REQ 1
 #define ARG_OPT 2
@@ -27,4 +29,8 @@ extern const struct opt OPTGET_INIT;
 
 extern int optget(struct opt *opt, char *av[], int flags);
 
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
 #endif // UTIL_OPTGET_H_W3LIZK1S
diff --git a/src/util/util.h b/src/util/util.h
index 82d2e19..9ee19dc 100644
--- a/src/util/util.h
+++ b/src/util/util.h
@@ -1,13 +1,15 @@
-// util/util.h, version 1.0.0
+// util/util.h, version 1.0.1
 // Utility header file from libutil
 // Copyright (C) 2021, Jakob Wakeling
 // All rights reserved.
 
-
-
 #ifndef UTIL_UTIL_H_KP8NS9DC
 #define UTIL_UTIL_H_KP8NS9DC
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <assert.h>
 #include <float.h>
 #include <stdbool.h>
@@ -64,4 +66,8 @@ typedef long double f128;
 /* Miscellaneous */
 #define BIT(x) (1 << (x))
 
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
 #endif // UTIL_UTIL_H_KP8NS9DC