[PATCH] D29312: [sanitizer] Ensure macro parameters are expanded before stringifying.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 10:48:39 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL293671: [sanitizer] Ensure macro parameters are expanded before stringifying. (authored by mpividori).

Changed prior to commit:
  https://reviews.llvm.org/D29312?vs=86359&id=86463#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D29312

Files:
  compiler-rt/trunk/lib/sanitizer_common/sanitizer_win_defs.h


Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_win_defs.h
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_win_defs.h
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_win_defs.h
@@ -23,7 +23,8 @@
 #endif
 
 // Intermediate macro to ensure the parameter is expanded before stringified.
-#define STRINGIFY(A) #A
+#define STRINGIFY_(A) #A
+#define STRINGIFY(A) STRINGIFY_(A)
 
 // ----------------- A workaround for the absence of weak symbols --------------
 // We don't have a direct equivalent of weak symbols when using MSVC, but we can
@@ -45,13 +46,10 @@
 // So, a workaround is to force linkage with the modules that include weak
 // definitions, with the following macro: WIN_FORCE_LINK()
 
-#define WIN_WEAK_ALIAS_(Name, Default)                                         \
+#define WIN_WEAK_ALIAS(Name, Default)                                          \
   __pragma(comment(linker, "/alternatename:" WIN_SYM_PREFIX STRINGIFY(Name) "="\
                                              WIN_SYM_PREFIX STRINGIFY(Default)))
 
-#define WIN_WEAK_ALIAS(Name, Default)                                          \
-  WIN_WEAK_ALIAS_(Name, Default)
-
 #define WIN_FORCE_LINK(Name)                                                   \
   __pragma(comment(linker, "/include:" WIN_SYM_PREFIX STRINGIFY(Name)))
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29312.86463.patch
Type: text/x-patch
Size: 1386 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170131/fc27544b/attachment.bin>


More information about the llvm-commits mailing list