From fa3669ee0bcd8005d684e9077bf7ed1b4ff43e07 Mon Sep 17 00:00:00 2001 From: Heimdal Developers Date: Wed, 24 Nov 2010 08:14:40 +0000 Subject: [PATCH] Import of code from heimdal 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 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/external/heimdal-last | 2 +- src/external/heimdal/roken/getopt.c | 13 ++++++++----- src/external/heimdal/roken/roken.h.in | 17 ++++++++++++----- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/external/heimdal-last b/src/external/heimdal-last index 0e30b39f9..4f564b11c 100644 --- a/src/external/heimdal-last +++ b/src/external/heimdal-last @@ -1 +1 @@ -bd78baf668eca011257f05fef8334e0967500456 +0cc7b890e2632a7cb26517825deb802f79e838f8 diff --git a/src/external/heimdal/roken/getopt.c b/src/external/heimdal/roken/getopt.c index 653853543..b177b010d 100644 --- a/src/external/heimdal/roken/getopt.c +++ b/src/external/heimdal/roken/getopt.c @@ -34,6 +34,9 @@ static char sccsid[] = "@(#)getopt.c 8.1 (Berkeley) 6/4/93"; #ifndef __STDC__ #define const #endif +#include +#include "roken.h" + #include #include #include @@ -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)':' diff --git a/src/external/heimdal/roken/roken.h.in b/src/external/heimdal/roken/roken.h.in index 654a5ad56..2fa6dca34 100644 --- a/src/external/heimdal/roken/roken.h.in +++ b/src/external/heimdal/roken/roken.h.in @@ -43,11 +43,18 @@ #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 -- 2.39.5