#ifndef __STDC__
#define const
#endif
+#include <config.h>
+#include "roken.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* 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)':'
#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
#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