summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-10-24 21:20:21 +0000
committerNicholas Clark <nick@ccl4.org>2005-10-24 21:20:21 +0000
commitce582ceece605be1a68752611f28e5b1a8e80455 (patch)
tree422b44c3eb2a02d29ccc40eed53e892cb22ddc2a /perl.h
parent78821a22f30aaed98d9c6643adb5ed18f868dbe7 (diff)
downloadperl-ce582ceece605be1a68752611f28e5b1a8e80455.tar.gz
Add my_sprintf, which is usually just a macro for sprintf, for those
places where we want to use the return value of sprintf. This allows a wrapper to be used for platforms where the C library isn't ANSI- conformant. p4raw-id: //depot/perl@25832
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/perl.h b/perl.h
index 11cfc75fdb..28d2ad81a0 100644
--- a/perl.h
+++ b/perl.h
@@ -1402,6 +1402,16 @@ int sockatmark(int);
# define sprintf UTS_sprintf_wrap
#endif
+/* For the times when you want the return value of sprintf, and you want it
+ to be the length. Can't have a thread variable passed in, because C89 has
+ no varargs macros.
+*/
+#ifdef SPRINTF_RETURNS_STRLEN
+# define my_sprintf sprintf
+#else
+# define my_sprintf Perl_my_sprintf
+#endif
+
/* Configure gets this right but the UTS compiler gets it wrong.
-- Hal Morris <hom00@utsglobal.com> */
#ifdef UTS