forked from OSchip/llvm-project
Move Windows getopt for building the DLL
llvm-svn: 202725
This commit is contained in:
parent
627f4ae811
commit
d582f69469
|
@ -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,
|
|
@ -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
|
||||
|
|
@ -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 != ':'))
|
||||
|
Loading…
Reference in New Issue