forked from include-what-you-use/include-what-you-use
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iwyu_getopt.h
48 lines (35 loc) · 1.07 KB
/
iwyu_getopt.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//===--- iwyu_getopt.h - OS-specific implementation of getopt for IWYU ----===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef INCLUDE_WHAT_YOU_USE_IWYU_GETOPT_H_
#define INCLUDE_WHAT_YOU_USE_IWYU_GETOPT_H_
#if defined(_MSC_VER)
#if defined(__cplusplus)
extern "C" {
#endif
#define no_argument 1
#define required_argument 2
#define optional_argument 3
extern char* optarg;
extern int optind, opterr, optopt;
struct option {
const char* name;
int has_arg;
int* flag;
int val;
};
int getopt(int argc, char* const argv[], const char* optstring);
int getopt_long(int argc, char* const argv[],
const char* optstring, const struct option* longopts, int* longindex);
#if defined(__cplusplus)
}
#endif
#else // #if defined(_MSC_VER)
#include <getopt.h> // IWYU pragma: export
#endif // #if defined(_MSC_VER)
#endif // INCLUDE_WHAT_YOU_USE_IWYU_GETOPT_H_