summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-03-12 22:43:10 -0500
committerTavian Barnes <tavianator@tavianator.com>2022-03-12 22:43:10 -0500
commit64426f1a89450a0f79b723a4d966f7f9c7492c60 (patch)
treeaeb9b990a501e5cc44e05fe26179b4c470b3a592
parent8ad8838d21a133fb8a48e1e88001ca3aed9baf9d (diff)
downloadbfs-64426f1a89450a0f79b723a4d966f7f9c7492c60.tar.xz
Don't shadow standard headers
@italic on the AUR stated that bfs from the AUR fails to build on Manjaro. From the build log, it seems like <time.h> doesn't get included properly. I assume it's picking up ./time.h instead. I couldn't reproduce the build issue in the default configuration, but it does fail with EXTRA_CFLAGS="-I." which isn't good. So rename everything with an x prefix to stop clashing. Link: https://aur.archlinux.org/packages/bfs#comment-856102 Link: https://paste.rs/eqR
-rw-r--r--Makefile10
-rw-r--r--eval.c4
-rw-r--r--exec.c2
-rw-r--r--expr.h2
-rw-r--r--main.c6
-rw-r--r--parse.c6
-rw-r--r--printf.c2
-rw-r--r--tests/xtimegm.c2
-rw-r--r--util.c2
-rw-r--r--xregex.c (renamed from regex.c)2
-rw-r--r--xregex.h (renamed from regex.h)0
-rw-r--r--xspawn.c (renamed from spawn.c)2
-rw-r--r--xspawn.h (renamed from spawn.h)0
-rw-r--r--xtime.c (renamed from time.c)2
-rw-r--r--xtime.h (renamed from time.h)0
15 files changed, 21 insertions, 21 deletions
diff --git a/Makefile b/Makefile
index 9ae4bd1..01b2c8d 100644
--- a/Makefile
+++ b/Makefile
@@ -217,17 +217,17 @@ bfs: \
parse.o \
printf.o \
pwcache.o \
- regex.o \
- spawn.o \
stat.o \
- time.o \
trie.o \
typo.o \
- util.o
+ util.o \
+ xregex.o \
+ xspawn.o \
+ xtime.o
tests/mksock: tests/mksock.o
tests/trie: trie.o tests/trie.o
-tests/xtimegm: time.o tests/xtimegm.o
+tests/xtimegm: xtime.o tests/xtimegm.o
$(BIN_GOALS):
+$(CC) $(ALL_LDFLAGS) $^ $(ALL_LDLIBS) -o $@
diff --git a/eval.c b/eval.c
index 321a8d9..41892d0 100644
--- a/eval.c
+++ b/eval.c
@@ -34,10 +34,10 @@
#include "printf.h"
#include "pwcache.h"
#include "stat.h"
-#include "time.h"
#include "trie.h"
#include "util.h"
-#include "regex.h"
+#include "xregex.h"
+#include "xtime.h"
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/exec.c b/exec.c
index 4cfb2e0..505e51c 100644
--- a/exec.c
+++ b/exec.c
@@ -20,8 +20,8 @@
#include "color.h"
#include "diag.h"
#include "dstring.h"
-#include "spawn.h"
#include "util.h"
+#include "xspawn.h"
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/expr.h b/expr.h
index a660a6d..23a6f41 100644
--- a/expr.h
+++ b/expr.h
@@ -25,8 +25,8 @@
#include "eval.h"
#include "exec.h"
#include "printf.h"
-#include "regex.h"
#include "stat.h"
+#include "xregex.h"
#include <stdbool.h>
#include <stddef.h>
#include <sys/types.h>
diff --git a/main.c b/main.c
index 2ad24a4..b40d245 100644
--- a/main.c
+++ b/main.c
@@ -43,13 +43,13 @@
* - fsade.[ch] (a facade over non-standard filesystem features)
* - mtab.[ch] (parses the system's mount table)
* - pwcache.[ch] (a cache for the user/group tables)
- * - regex.[ch] (regular expression support)
- * - spawn.[ch] (spawns processes)
* - stat.[ch] (wraps stat(), or statx() on Linux)
- * - time.[ch] (date/time handling utilities)
* - trie.[ch] (a trie set/map implementation)
* - typo.[ch] (fuzzy matching for typos)
* - util.[ch] (everything else)
+ * - xregex.[ch] (regular expression support)
+ * - xspawn.[ch] (spawns processes)
+ * - xtime.[ch] (date/time handling utilities)
*/
#include "ctx.h"
diff --git a/parse.c b/parse.c
index 3439f23..04789da 100644
--- a/parse.c
+++ b/parse.c
@@ -36,12 +36,12 @@
#include "opt.h"
#include "printf.h"
#include "pwcache.h"
-#include "spawn.h"
#include "stat.h"
-#include "time.h"
#include "typo.h"
#include "util.h"
-#include "regex.h"
+#include "xregex.h"
+#include "xspawn.h"
+#include "xtime.h"
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/printf.c b/printf.c
index 3e7df7d..b259104 100644
--- a/printf.c
+++ b/printf.c
@@ -24,8 +24,8 @@
#include "mtab.h"
#include "pwcache.h"
#include "stat.h"
-#include "time.h"
#include "util.h"
+#include "xtime.h"
#include <assert.h>
#include <errno.h>
#include <grp.h>
diff --git a/tests/xtimegm.c b/tests/xtimegm.c
index 2788dee..f4e28ee 100644
--- a/tests/xtimegm.c
+++ b/tests/xtimegm.c
@@ -14,7 +14,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
****************************************************************************/
-#include "../time.h"
+#include "../xtime.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
diff --git a/util.c b/util.c
index 21921e8..f67406c 100644
--- a/util.c
+++ b/util.c
@@ -16,7 +16,7 @@
#include "util.h"
#include "dstring.h"
-#include "regex.h"
+#include "xregex.h"
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/regex.c b/xregex.c
index 9785bf8..3c3cf35 100644
--- a/regex.c
+++ b/xregex.c
@@ -14,7 +14,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
****************************************************************************/
-#include "regex.h"
+#include "xregex.h"
#include "util.h"
#include <assert.h>
#include <errno.h>
diff --git a/regex.h b/xregex.h
index 63cd120..63cd120 100644
--- a/regex.h
+++ b/xregex.h
diff --git a/spawn.c b/xspawn.c
index 31f9897..93c270a 100644
--- a/spawn.c
+++ b/xspawn.c
@@ -14,7 +14,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
****************************************************************************/
-#include "spawn.h"
+#include "xspawn.h"
#include "util.h"
#include <errno.h>
#include <fcntl.h>
diff --git a/spawn.h b/xspawn.h
index 0dd9d61..0dd9d61 100644
--- a/spawn.h
+++ b/xspawn.h
diff --git a/time.c b/xtime.c
index c7331b5..b83bf20 100644
--- a/time.c
+++ b/xtime.c
@@ -14,7 +14,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
****************************************************************************/
-#include "time.h"
+#include "xtime.h"
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
diff --git a/time.h b/xtime.h
index 0f9adb4..0f9adb4 100644
--- a/time.h
+++ b/xtime.h