From ce6e9a234e4e6e007d0d0de852fefd7bc231c52a Mon Sep 17 00:00:00 2001 From: Julien Portalier Date: Thu, 9 Jan 2025 14:15:23 +0100 Subject: [PATCH] Fix: macro 'class_property' must be defined --- src/crystal/once.cr | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/crystal/once.cr b/src/crystal/once.cr index 0460a82d0f6b..bc190802ac03 100644 --- a/src/crystal/once.cr +++ b/src/crystal/once.cr @@ -27,7 +27,13 @@ {% if flag?(:preview_mt) || flag?(:win32) %} @@once_mutex = uninitialized Mutex - class_property once_mutex : Mutex + + def self.once_mutex : Mutex + @@once_mutex + end + + def self.once_mutex=(@@once_mutex : Mutex) + end {% end %} # Using @[NoInline] so LLVM optimizes for the hot path (var already