summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Allsopp <david.allsopp@metastack.com>2022-03-13 18:04:55 +0000
committerGitHub <noreply@github.com>2022-03-13 19:04:55 +0100
commit5271b8600999b35eee6f87000d1b41ed6330ab78 (patch)
tree947096b242627130da1678f2aa928b5395c2669a
parent82bcecce91788f2a336990ea0f9d26271601ef25 (diff)
downloadocaml-5271b8600999b35eee6f87000d1b41ed6330ab78.tar.gz
Rename symbol for Caml_state to caml_state (#10925)
`Caml_state` is a macro on macOS and a symbol elsewhere. Given that the symbol can never be relied on, this PR changes it to be `caml_state`, prefixed in the same way as the other runtime global symbols and removes the special case from the global symbol checker.
-rw-r--r--runtime/caml/domain_state.h3
-rw-r--r--runtime/domain.c2
-rwxr-xr-xtools/check-symbol-names2
3 files changed, 3 insertions, 4 deletions
diff --git a/runtime/caml/domain_state.h b/runtime/caml/domain_state.h
index e708bbe021..4e87008b85 100644
--- a/runtime/caml/domain_state.h
+++ b/runtime/caml/domain_state.h
@@ -60,7 +60,8 @@ CAML_STATIC_ASSERT(
#define SET_Caml_state(x) \
(pthread_setspecific(caml_domain_state_key, x))
#else
- CAMLextern __thread caml_domain_state* Caml_state;
+ CAMLextern __thread caml_domain_state* caml_state;
+ #define Caml_state caml_state
#define CAML_INIT_DOMAIN_STATE
#define SET_Caml_state(x) (Caml_state = (x))
#endif
diff --git a/runtime/domain.c b/runtime/domain.c
index d5ae63f7b7..f04b63df55 100644
--- a/runtime/domain.c
+++ b/runtime/domain.c
@@ -247,7 +247,7 @@ void caml_init_domain_state_key (void)
}
#else
-CAMLexport __thread caml_domain_state* Caml_state;
+CAMLexport __thread caml_domain_state* caml_state;
#endif
/* Interrupt functions */
diff --git a/tools/check-symbol-names b/tools/check-symbol-names
index 048eb5d1b3..a8afe539d5 100755
--- a/tools/check-symbol-names
+++ b/tools/check-symbol-names
@@ -26,8 +26,6 @@ $3 ~ /^[a-zU]$/ { next }
# ignore "main", which should be externally linked
$2 ~ /^_?main$/ { next }
$2 ~ /^_?wmain$/ { next }
-# Caml_state escapes the prefixing rule for now
-$2 ~ /^_?Caml_state$/ { next }
# for x86 PIC mode
$2 ~ /^__x86.get_pc_thunk./ { next }
# for mingw32