]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
iconv: use bswap_32 instead of __builtin_bswap32
authorCollin Funk <collin.funk1@gmail.com>
Tue, 5 Aug 2025 08:07:18 +0000 (10:07 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 5 Aug 2025 08:07:18 +0000 (10:07 +0200)
This file uses a mix of both functions, prefer the non-builtin version.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
iconv/gconv_simple.c

index 1e29eb1a807c03475cbd254e322bb7a74d2c9777..0ebdccee909ec260b68a5b864831599407039f9b 100644 (file)
@@ -90,7 +90,7 @@ internal_ucs4_loop (struct __gconv_step *step,
   for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4, outptr += 4)
     {
       uint32_t val = get32 (inptr);
-      put32 (outptr, __builtin_bswap32 (val));
+      put32 (outptr, bswap_32 (val));
     }
 
   *inptrp = inptr;
@@ -196,7 +196,7 @@ ucs4_internal_loop (struct __gconv_step *step,
     {
       uint32_t inval = get32 (inptr);
 #if __BYTE_ORDER == __LITTLE_ENDIAN
-      inval = __builtin_bswap32 (inval);
+      inval = bswap_32 (inval);
 #endif
 
       if (__glibc_unlikely (inval > 0x7fffffff))
@@ -337,7 +337,7 @@ internal_ucs4le_loop (struct __gconv_step *step,
   for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4, outptr += 4)
     {
       uint32_t val = get32 (inptr);
-      put32 (outptr, __builtin_bswap32 (val));
+      put32 (outptr, bswap_32 (val));
     }
 
   *inptrp = inptr;
@@ -442,7 +442,7 @@ ucs4le_internal_loop (struct __gconv_step *step,
     {
       uint32_t inval = get32 (inptr);
 #if __BYTE_ORDER == __BIG_ENDIAN
-      inval = __builtin_bswap32 (inval);
+      inval = bswap_32 (inval);
 #endif
 
       if (__glibc_unlikely (inval > 0x7fffffff))