changeset 55:3b3750063786 noffle

[svn] * src/portable.h: Added file. This #defines some macros, so the code uses __snprintf() and __vsnprintf if snprintf and vsnprintf aren't available. This is the case on SunOS, for example.
author uh1763
date Tue, 09 May 2000 23:32:33 +0100
parents 125d79c9e586
children 688bd51704e0
files ChangeLog src/portable.h
diffstat 2 files changed, 41 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue May 09 23:28:38 2000 +0100
+++ b/ChangeLog	Tue May 09 23:32:33 2000 +0100
@@ -20,6 +20,10 @@
    and logSignal() to RETSIGTYPE, which is either void or int, depending on
    the system you compile on (autoconf #defines the RETSIGTYPE).
 
+ * src/portable.h: Added file. This #defines some macros, so the code uses
+   __snprintf() and __vsnprintf if snprintf and vsnprintf aren't available.
+   This is the case on SunOS, for example.
+
 
 Sat May  6 12:25:39 BST 2000  Jim Hague <jim.hague@acm.org>
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/portable.h	Tue May 09 23:32:33 2000 +0100
@@ -0,0 +1,37 @@
+/*
+  portable.h
+
+  Compatibility checks and fallback-functions.
+
+  $Id: portable.h 61 2000-05-09 22:32:33Z uh1763 $
+*/
+
+#ifndef PORTABLE_H
+#define PORTABLE_H    /* To stop multiple inclusions. */
+
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if !defined(HAVE_VSNPRINTF) && defined(HAVE___VSNPRINTF)
+#undef vsnprintf
+#define vsnprintf __vsnprintf
+#define HAVE_VSNPRINTF
+#endif
+
+/* This is *not* good, because vsprintf() doesn't do any bounds-checking */
+#if !defined(HAVE_VSNPRINTF) && !defined(HAVE___VSNPRINTF)
+#define vsnprintf(c, len, fmt, args) vsprintf(c, fmt, args)
+#define HAVE_VSNPRINTF
+#endif
+
+#if !defined(HAVE_SNPRINTF) && defined(HAVE___SNPRINTF)
+#undef snprintf
+#define snprintf __snprintf
+#define HAVE_SNPRINTF
+#endif
+
+
+#endif
+