provide-snprintf-for-irix-dux-20010212
authorDerrick Brashear <shadow@dementia.org>
Tue, 13 Feb 2001 03:46:15 +0000 (03:46 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 13 Feb 2001 03:46:15 +0000 (03:46 +0000)
So we can use snprintf, provide it for platforms that don't have it

src/util/Makefile
src/util/snprintf.c

index 9b13770..86eaded 100644 (file)
@@ -16,7 +16,7 @@ INSTALL = ${SRCDIR}bin/install
 objects = assert.o base64.o casestrcpy.o ktime.o volparse.o hostparse.o \
         hputil.o kreltime.o isathing.o get_krbrlm.o uuid.o serverLog.o \
         dirpath.o fileutil.o netutils.o flipbase64.o \
-        afs_atomlist.o afs_lhash.o
+        afs_atomlist.o afs_lhash.o snprintf.o
 
 headers = assert.h potpourri.h itc.h errors.h afsutil.h pthread_glock.h \
          dirpath.h afs_atomlist.h afs_lhash.h
@@ -76,6 +76,9 @@ util.a: ${objects} AFS_component_version_number.o
 volparse.o: volparse.c
        ${CC} ${CFLAGS} -c volparse.c
 
+snprintf.o: snprintf.c
+       ${CC} ${CFLAGS} -c snprintf.c
+
 base64.o: base64.c
        ${CC} ${CFLAGS} -c base64.c
 
index bad2699..c789dc7 100644 (file)
@@ -1,5 +1,8 @@
 /* snprintf.c - Formatted, length-limited print to a string */
 
+#include <afs/param.h>
+#if defined(AFS_OSF20_ENV) || defined(AFS_SGI51_ENV)
+
 #include <sys/types.h>
 #include <stdarg.h>
 #include <stdio.h>
@@ -381,3 +384,4 @@ void snprintf(char *p, unsigned int avail, char *fmt, ...)
   vsnprintf(p, avail, fmt, ap);
   va_end(ap);
 }
+#endif /* AFS_OSF20_ENV || AFS_SGI51_ENV */