Protect C language extensions with two leading and trailing underscores

This should make their usage safer against user macros.
This commit is contained in:
Guillem Jover
2018-06-18 00:36:44 +02:00
parent c2d9d84088
commit 574c7a1365
6 changed files with 15 additions and 12 deletions

View File

@@ -287,9 +287,12 @@ __asm__(".symver setproctitle_impl,setproctitle@@LIBBSD_0.5");
* for code linking against that version, and change the default to use the
* new version, so that new code depends on the implemented version. */
#ifdef HAVE_TYPEOF
extern typeof(setproctitle_impl) setproctitle_stub __attribute__((alias("setproctitle_impl")));
extern __typeof__(setproctitle_impl)
setproctitle_stub
__attribute__((__alias__("setproctitle_impl")));
#else
void setproctitle_stub(const char *fmt, ...)
__attribute__((alias("setproctitle_impl")));
void
setproctitle_stub(const char *fmt, ...)
__attribute__((__alias__("setproctitle_impl")));
#endif
__asm__(".symver setproctitle_stub,setproctitle@LIBBSD_0.2");