bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

improve clang support (39)


From: Bruno Haible
Subject: improve clang support (39)
Date: Sun, 16 Aug 2020 19:07:23 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-186-generic; KDE/5.18.0; x86_64; ; )

clang supports referencing a symbol under a different name at the assembler
level, like GCC. Also it supports __USER_LABEL_PREFIX__, like GCC (this is
an underscore on 32-bit native Windows, but empty on 64-bit native Windows).


2020-08-16  Bruno Haible  <bruno@clisp.org>

        libc-config: Enable __REDIRECT macro also on clang.
        * lib/cdefs.h (__REDIRECT, __REDIRECT_NTH, __REDIRECT_NTHNL, __ASMNAME,
        __ASMNAME2): Define on clang like on GCC.

diff --git a/lib/cdefs.h b/lib/cdefs.h
index 67ad180..74da734 100644
--- a/lib/cdefs.h
+++ b/lib/cdefs.h
@@ -194,7 +194,7 @@
    Example:
    int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */
 
-#if defined __GNUC__ && __GNUC__ >= 2
+#if (defined __GNUC__ && __GNUC__ >= 2) || (__clang_major__ >= 4)
 
 # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias))
 # ifdef __cplusplus




reply via email to

[Prev in Thread] Current Thread [Next in Thread]