]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib/replace: add _ALIGNED_(n) as __attribute__((aligned(n)))
authorAndreas Schneider <asn@samba.org>
Wed, 20 May 2026 17:26:27 +0000 (19:26 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 21 May 2026 17:25:33 +0000 (17:25 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=16006

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
lib/replace/replace.h

index 8c0c572fbc8aa08ce891722f2d6d92659bc50e6d..78f44a8878a0120c7daf010043f6df5317567e40 100644 (file)
@@ -476,6 +476,14 @@ int rep_dlclose(void *handle);
 #endif
 #endif
 
+#ifndef _ALIGNED_
+#if __has_attribute(aligned) || (__GNUC__ >= 3)
+#define _ALIGNED_(n) __attribute__((aligned(n)))
+#else
+#define _ALIGNED_(n)
+#endif
+#endif
+
 #if !defined(HAVE_VDPRINTF) || !defined(HAVE_C99_VSNPRINTF)
 #define vdprintf rep_vdprintf
 int rep_vdprintf(int fd, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0);