From 3bf94be443bfe2ab00307ad24df4f4420a1aac2e Mon Sep 17 00:00:00 2001 From: mquinson Date: Tue, 1 Mar 2005 07:44:20 +0000 Subject: [PATCH] Define a wrapper to strings for when printf(%s,NULL) segfaults git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1126 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/portable.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/portable.h b/src/portable.h index 420ebd3f66..bd7c397e03 100644 --- a/src/portable.h +++ b/src/portable.h @@ -131,5 +131,16 @@ const char *gras_wsa_err2string(int errcode); # include "xbt/context_win32.h" /* Manual reimplementation for prehistoric platforms */ #endif +/** + ** What is needed to protect solaris's printf from ever seing NULL associated to a %s format + ** (without adding an extra check on linux :) + **/ + +#ifdef PRINTF_NULL_WORKING +# define PRINTF_STR(a) (a) +#else +# define PRINTF_STR(a) (a)?:"(null)" +#endif + #endif /* GRAS_PORTABLE_H */ -- 2.20.1