Move Windows getopt for building the DLL

llvm-svn: 202725
This commit is contained in:
Deepak Panickal 2014-03-03 15:52:27 +00:00
parent 627f4ae811
commit d582f69469
3 changed files with 22 additions and 6 deletions

View File

@ -1,5 +1,7 @@
#pragma once
#include "lldb/lldb-dll-export.h"
// from getopt.h
#define no_argument 0
#define required_argument 1
@ -19,13 +21,13 @@ struct option
int getopt( int argc, char * const argv[], const char *optstring );
// from getopt.h
extern char * optarg;
extern int optind;
extern LLDB_API char * optarg;
extern LLDB_API int optind;
extern int opterr;
extern int optopt;
// defined in unistd.h
extern int optreset;
extern LLDB_API int optreset;
int getopt_long
(
@ -36,7 +38,7 @@ int getopt_long
int *longindex
);
int getopt_long_only
LLDB_API int getopt_long_only
(
int argc,
char * const *argv,

View File

@ -0,0 +1,14 @@
#pragma once
#if defined (_MSC_VER)
# if defined(EXPORT_LIBLLDB)
# define LLDB_API __declspec(dllexport)
# elif defined(IMPORT_LIBLLDB)
# define LLDB_API __declspec(dllimport)
# else
# define LLDB_API
# endif
#else /* defined (_MSC_VER) */
# define LLDB_API
#endif

View File

@ -1,4 +1,4 @@
#include "lldb/Host/windows/GetOptInc.h"
#include "lldb/Host/windows/getopt/GetOptInc.h"
// getopt.cpp
#include <errno.h>
@ -9,7 +9,7 @@ int opterr = 1; /* if error message should be printed */
int optind = 1; /* index into parent argv vector */
int optopt = '?'; /* character checked for validity */
int optreset; /* reset getopt */
char *optarg; /* argument associated with option */
char *optarg; /* argument associated with option */
#define PRINT_ERROR ((opterr) && (*options != ':'))