Skip to content

Commit 69a28d5

Browse files
committed
Fix #287
1 parent 048f311 commit 69a28d5

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

httplib.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,8 @@ class SSLClient : public Client {
912912
};
913913
#endif
914914

915+
// ----------------------------------------------------------------------------
916+
915917
/*
916918
* Implementation
917919
*/
@@ -4435,6 +4437,8 @@ inline bool SSLClient::check_host_name(const char *pattern,
44354437
}
44364438
#endif
44374439

4440+
// ----------------------------------------------------------------------------
4441+
44384442
} // namespace httplib
44394443

44404444
#endif // CPPHTTPLIB_HTTPLIB_H

split.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import os
2+
3+
border = '// ----------------------------------------------------------------------------'
4+
5+
with open('httplib.h') as f:
6+
lines = f.readlines()
7+
inImplementation = False
8+
os.makedirs('out', exist_ok=True)
9+
with open('out/httplib.h', 'w') as fh:
10+
with open('out/httplib.cc', 'w') as fc:
11+
fc.write('#include "httplib.h"\n')
12+
fc.write('namespace httplib {\n')
13+
for line in lines:
14+
isBorderLine = border in line
15+
if isBorderLine:
16+
inImplementation = not inImplementation
17+
else:
18+
if inImplementation:
19+
fc.write(line.replace('inline ', ''))
20+
pass
21+
else:
22+
fh.write(line)
23+
pass
24+
fc.write('} // namespace httplib\n')

0 commit comments

Comments
 (0)