File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1
1
env = DefaultEnvironment ()
2
2
env .AppendUnique (CCFLAGS = ['-O2' , '-std=c++11' ])
3
3
4
+ import platform
5
+ if platform .system () == "Darwin" :
6
+ env .AppendUnique (CPPDEFINES = ['SYSTEM_DARWIN' ])
7
+ elif platform .system () == "Linux" :
8
+ env .AppendUnique (CPPDEFINES = ['SYSTEM_LINUX' ])
9
+
4
10
env .StaticLibrary ('eapauth' ,
5
11
[
6
12
'eapauth.cpp' ,
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ EAPClient::EAPClient(const std::string &iface) {
37
37
38
38
mac_addr_t mac_addr;
39
39
40
- #ifdef SYSTEM_LINUX
40
+ #ifdef SYSTEM_LINUX
41
41
if ((client_fd = socket (AF_PACKET, SOCK_RAW, htons (ETHERTYPE_PAE))) < 0 ) {
42
42
perror (" socket" );
43
43
abort ();
@@ -83,8 +83,8 @@ EAPClient::EAPClient(const std::string &iface) {
83
83
abort ();
84
84
}
85
85
86
- #elif SYSTEM_DARWIN // FOR Darwin
87
-
86
+ #elif SYSTEM_DARWIN // FOR Darwin
87
+
88
88
if ((bpf_fd = open (" /dev/bpf1" , O_RDWR)) < 0 ) {
89
89
perror (" open" );
90
90
abort ();
@@ -138,7 +138,9 @@ EAPClient::EAPClient(const std::string &iface) {
138
138
139
139
this ->timeout .tv_sec = 30 ;
140
140
this ->timeout .tv_usec = 0 ;
141
- #endif
141
+ #else
142
+ #error SYSUH3C doesn't support your platform.
143
+ #endif
142
144
143
145
// Generate ethernet header
144
146
You can’t perform that action at this time.
0 commit comments