git: db50099480e7 - stable/15 - libc: Reorganise memory_order enumeration constants

From: Faraz Vahedi <kfv_at_FreeBSD.org>
Date: Sat, 31 Oct 2026 10:06:31 UTC
The branch stable/15 has been updated by kfv:

URL: https://cgit.FreeBSD.org/src/commit/?id=db50099480e78dff37457514af08716e45a48124

commit db50099480e78dff37457514af08716e45a48124
Author:     Faraz Vahedi <kfv@FreeBSD.org>
AuthorDate: 2026-05-01 17:49:27 +0000
Commit:     Faraz Vahedi <kfv@FreeBSD.org>
CommitDate: 2026-10-31 10:03:30 +0000

    libc: Reorganise memory_order enumeration constants
    
    Place the `memory_order` enumeration constants alongside the corresponding
    typedef under the ยง7.17.3 heading.
    
    The previous layout separated the fallback constant definitions from the
    enum, which could obscure their relationship. These fallbacks exist only
    to provide values when the compiler does not supply the builtins.
    
    The removed comment encoded implementation-specific assumptions about
    compiler-provided definitions and implied a relationship between Clang/GCC
    macros and fallback values. In practice, the fallback definitions exist
    solely to ensure the enumerators are defined when compiler intrinsics are
    absent, and do not depend on any particular numeric mapping.
    
    No functional change; this is a mere structural and clarity improvement.
    
    Signed-off-by: Faraz Vahedi <kfv@kfv.io>
    Reviewed by: imp
    Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
    (cherry picked from commit e17fddce8978efbc70fc473425bad59b111f4b16)
---
 sys/sys/stdatomic.h | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h
index e6eb46cd6ef3..135001a1f82e 100644
--- a/sys/sys/stdatomic.h
+++ b/sys/sys/stdatomic.h
@@ -101,9 +101,10 @@
 #endif
 
 /*
- * Clang and recent GCC both provide predefined macros for the memory
- * orderings.  If we are using a compiler that doesn't define them, use the
- * clang values - these will be ignored in the fallback path.
+ * 7.17.3 Order and consistency.
+ *
+ * The memory_order_* constants that denote the barrier behaviour of the
+ * atomic operations.
  */
 
 #ifndef __ATOMIC_RELAXED
@@ -125,13 +126,6 @@
 #define __ATOMIC_SEQ_CST		5
 #endif
 
-/*
- * 7.17.3 Order and consistency.
- *
- * The memory_order_* constants that denote the barrier behaviour of the
- * atomic operations.
- */
-
 typedef enum {
 	memory_order_relaxed = __ATOMIC_RELAXED,
 	memory_order_consume = __ATOMIC_CONSUME,