================
@@ -48,4 +48,24 @@
// LIBC_COPT_PRINTF_NO_NULLPTR_CHECKS
+#ifdef LIBC_COPT_PRINTF_MODULAR
+#define LIBC_PRINTF_MODULE_DECL __attribute__((weak))
+#else
+#define LIBC_PRINTF_MODULE_DECL LIBC_INLINE
+#endif
+
+// LIBC_PRINTF_MODULE: Defines/declares a printf module.
+//
+// Usage: LIBC_PRINTF_MODULE((<signature>), { <body> })
+//
+// Note that the signature is parenthesized, but the body is not.
----------------
michaelrj-google wrote:
it seems like you want to add an attribute to the function, similar to what we
do with LIBC_INLINE. Is there a reason you can't just put
`LIBC_PRINTF_MODULE_DECL` in front of the function definitions? That seems like
it would be simpler and would avoid putting the body of the function inside the
macro.
https://github.com/llvm/llvm-project/pull/147426
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits