[Brlcad-commits] CVS: brlcad/src/libsysv getopt.c,14.2,14.3 memset.c,14.2,14.3 strchr.c,14.2,14.3
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: Sean M. <br...@us...> - 2005-08-24 02:52:51
|
Update of /cvsroot/brlcad/brlcad/src/libsysv In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6624 Modified Files: getopt.c memset.c strchr.c Log Message: don't compile these functions being provided for convenience if the system already has them Index: getopt.c =================================================================== RCS file: /cvsroot/brlcad/brlcad/src/libsysv/getopt.c,v retrieving revision 14.2 retrieving revision 14.3 diff -w -u -r14.2 -r14.3 --- getopt.c 21 Dec 2004 07:18:58 -0000 14.2 +++ getopt.c 24 Aug 2005 02:52:42 -0000 14.3 @@ -6,20 +6,10 @@ * to reinitialize optind=1 before beginning on the next argument list. * */ -#ifndef lint -static char RCSid[] = "@(#)$Header$ (BRL)"; -#endif #include "common.h" - - -#if defined(HAVE_GETOPT) -#ifndef lint -char getopt_dummy; /* some systems can't handle empty object modules */ -#else -#endif -#else +#ifndef HAVE_GETOPT #include <stdio.h> #ifdef HAVE_STRING_H @@ -28,23 +18,12 @@ #include <strings.h> #endif -#include "machine.h" - /* * get option letter from argument vector */ -#if defined(__convexc__) -/* brain dead Convex compiler/loader won't let us redefine a variable declared - * and initialized in their library, despite the fact that we don't even use - * that module of their library! - */ -extern int opterr; /* set to zero to suppress errors */ -extern int optind; /* index into parent argv vector */ -#else int opterr = 1; /* set to zero to suppress errors */ int optind = 1; /* index into parent argv vector */ -#endif int optopt; /* character checked for validity */ char *optarg; /* argument associated with option */ @@ -56,15 +35,7 @@ } return(BADCH); int -getopt(nargc,nargv,ostr) -int nargc; -#if defined(linux) -char * const nargv[]; -const char *ostr; -#else -char *nargv[]; -char *ostr; -#endif +getopt(int nargc, char *nargv[], const char *ostr) { static char *place = EMSG; /* option letter processing */ register char *oli; /* option letter list index */ Index: memset.c =================================================================== RCS file: /cvsroot/brlcad/brlcad/src/libsysv/memset.c,v retrieving revision 14.2 retrieving revision 14.3 diff -w -u -r14.2 -r14.3 --- memset.c 21 Dec 2004 07:18:58 -0000 14.2 +++ memset.c 24 Aug 2005 02:52:42 -0000 14.3 @@ -13,6 +13,12 @@ static char RCSid[] = "@(#)$Header$ (BRL)"; #endif +#include "common.h" + +/* + * defined for the folks that don't seem to have a system memset() + */ +#ifndef HAVE_MEMSET char * memset(char *s, register char c, register int n) @@ -26,6 +32,8 @@ return s; } +#endif + /* * Local Variables: * mode: C Index: strchr.c =================================================================== RCS file: /cvsroot/brlcad/brlcad/src/libsysv/strchr.c,v retrieving revision 14.2 retrieving revision 14.3 diff -w -u -r14.2 -r14.3 --- strchr.c 21 Dec 2004 07:18:58 -0000 14.2 +++ strchr.c 24 Aug 2005 02:52:42 -0000 14.3 @@ -11,6 +11,13 @@ static char RCSid[] = "@(#)$Header$ (BRL)"; #endif +#include "common.h" + +/* + * defined for folks that don't have a system strchr() + */ +#ifndef HAVE_STRCHR + char * strchr(register char *sp, register char c) { @@ -21,6 +28,8 @@ return( (char *)0 ); } +#endif + /* * Local Variables: * mode: C |