]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Import of code from heimdal
authorHeimdal Developers <heimdal-discuss@sics.se>
Wed, 24 Nov 2010 08:14:40 +0000 (08:14 +0000)
committerJeffrey Altman <jaltman@openafs.org>
Wed, 24 Nov 2010 09:07:07 +0000 (01:07 -0800)
This commit updates the code imported from heimdal to
0cc7b890e2632a7cb26517825deb802f79e838f8 (switch-from-svn-to-git-1702-g0cc7b89)

Upstream changes are:

Asanka C. Herath (3):
      Annotate exported variables in getopt.c
      Windows: Support building roken as a DLL
      Declarations for getopt externs

Simon Wilkinson (1):
      roken: getopt should include roken.h

Change-Id: I5ef850bcac7dace3a8206958783ed6fd5830492e
Reviewed-on: http://gerrit.openafs.org/3378
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
src/external/heimdal-last
src/external/heimdal/roken/getopt.c
src/external/heimdal/roken/roken.h.in

index 0e30b39f9759980d1206e006bb6fc72624a6a960..4f564b11caf077e2b67b79c2717172a3f1d193a8 100644 (file)
@@ -1 +1 @@
-bd78baf668eca011257f05fef8334e0967500456
+0cc7b890e2632a7cb26517825deb802f79e838f8
index 653853543bad7ff89fbe46ab74873ba907043db1..b177b010d8be34e06dd33e9cf6b97a229e1c0dc4 100644 (file)
@@ -34,6 +34,9 @@ static char sccsid[] = "@(#)getopt.c  8.1 (Berkeley) 6/4/93";
 #ifndef __STDC__
 #define const
 #endif
+#include <config.h>
+#include "roken.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -41,11 +44,11 @@ static char sccsid[] = "@(#)getopt.c        8.1 (Berkeley) 6/4/93";
 /*
  * get option letter from argument vector
  */
-int    opterr = 1,             /* if error message should be printed */
-       optind = 1,             /* index into parent argv vector */
-       optopt,                 /* character checked for validity */
-       optreset;               /* reset getopt */
-char   *optarg;                /* argument associated with option */
+ROKEN_LIB_VARIABLE int opterr = 1; /* if error message should be printed */
+ROKEN_LIB_VARIABLE int optind = 1; /* index into parent argv vector */
+ROKEN_LIB_VARIABLE int optopt;   /* character checked for validity */
+int    optreset;                /* reset getopt */
+ROKEN_LIB_VARIABLE char        *optarg; /* argument associated with option */
 
 #define        BADCH   (int)'?'
 #define        BADARG  (int)':'
index 654a5ad56ad0dfd1024b93dd348a69486a2b9cb2..2fa6dca3494b6d8b15993eb375a2b8e67156223e 100644 (file)
 
 #ifndef ROKEN_LIB_FUNCTION
 #ifdef _WIN32
-#define ROKEN_LIB_FUNCTION
-#define ROKEN_LIB_CALL     __cdecl
+#  define ROKEN_LIB_CALL     __cdecl
+#  ifdef ROKEN_LIB_DYNAMIC
+#    define ROKEN_LIB_FUNCTION __declspec(dllimport)
+#    define ROKEN_LIB_VARIABLE __declspec(dllimport)
+#  else
+#    define ROKEN_LIB_FUNCTION
+#    define ROKEN_LIB_VARIABLE
+#  endif
 #else
 #define ROKEN_LIB_FUNCTION
 #define ROKEN_LIB_CALL
+#define ROKEN_LIB_VARIABLE
 #endif
 #endif
 
@@ -759,13 +766,13 @@ ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL vsyslog(int, const char *, va_list);
 #endif
 
 #if !HAVE_DECL_OPTARG
-extern char *optarg;
+ROKEN_LIB_VARIABLE extern char *optarg;
 #endif
 #if !HAVE_DECL_OPTIND
-extern int optind;
+ROKEN_LIB_VARIABLE extern int optind;
 #endif
 #if !HAVE_DECL_OPTERR
-extern int opterr;
+ROKEN_LIB_VARIABLE extern int opterr;
 #endif
 
 #ifndef HAVE_GETIPNODEBYNAME