Fix usage of __USER_LABEL_PREFIX__

The predefined __USER_LABEL_PREFIX__ macro if it is non-empty contains
an identifier, not a string literal, thus it needs to be stringified.
This commit is contained in:
Trutz Behn 2015-06-02 21:33:39 +02:00 committed by sin
parent ec970ecb88
commit a9ee1d2743

View File

@ -16,7 +16,9 @@
#ifndef _FORTIFY_HEADERS_H
#define _FORTIFY_HEADERS_H
#define fortify_fn(fn) __typeof__(fn) __orig_##fn __asm__(__USER_LABEL_PREFIX__ #fn); \
#define _FORTIFY_STR(s) #s
#define _FORTIFY_ORIG(p,fn) __typeof__(fn) __orig_##fn __asm__(_FORTIFY_STR(p) #fn)
#define fortify_fn(fn) _FORTIFY_ORIG(__USER_LABEL_PREFIX__,fn); \
extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__))
#endif