summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-10-03 13:07:21 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-10-03 13:07:21 -0400
commita96ddeb7dc528d29d05f52a9b8857b2f8924fddc (patch)
treee2a9f86399f4b5da48a27e94d8b10812e63569f7 /src
parent9b1ee97d13985f42b09f02c8a25459a910004eb5 (diff)
downloadbfs-a96ddeb7dc528d29d05f52a9b8857b2f8924fddc.tar.xz
thread: s/call_once/invoke_once/
call_once() is a reserved identifier from C11.
Diffstat (limited to 'src')
-rw-r--r--src/bfstd.c2
-rw-r--r--src/thread.h2
-rw-r--r--src/xregex.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/bfstd.c b/src/bfstd.c
index 1a5a67d..fcf4a6d 100644
--- a/src/bfstd.c
+++ b/src/bfstd.c
@@ -651,7 +651,7 @@ static bool xiswprint(wchar_t c, enum wesc_flags flags) {
/** Get the length of the longest printable prefix of a string. */
static size_t printable_len(const char *str, size_t len, enum wesc_flags flags) {
static pthread_once_t once = PTHREAD_ONCE_INIT;
- call_once(&once, char_cache_init);
+ invoke_once(&once, char_cache_init);
// Fast path: avoid multibyte checks
size_t i, word;
diff --git a/src/thread.h b/src/thread.h
index b2edf17..45b5e1f 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -97,7 +97,7 @@
/**
* Wrapper for pthread_once().
*/
-#define call_once(once, fn) \
+#define invoke_once(once, fn) \
thread_verify(pthread_once(once, fn), errno == 0)
#endif // BFS_THREAD_H
diff --git a/src/xregex.c b/src/xregex.c
index b9c04bf..87b692e 100644
--- a/src/xregex.c
+++ b/src/xregex.c
@@ -107,7 +107,7 @@ static void bfs_onig_once(void) {
/** Initialize Oniguruma. */
static int bfs_onig_initialize(OnigEncoding *enc) {
static pthread_once_t once = PTHREAD_ONCE_INIT;
- call_once(&once, bfs_onig_once);
+ invoke_once(&once, bfs_onig_once);
*enc = bfs_onig_enc;
return bfs_onig_status;