Skip to content

Commit 532719c

Browse files
authored
Merge pull request #126 from moteus/master
Change. Unset system macros only temporary.
2 parents e0bef3d + 49fcdea commit 532719c

File tree

2 files changed

+68
-5
lines changed

2 files changed

+68
-5
lines changed

src/lcopteasy.h

Lines changed: 68 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
#undef INTERFACE
2-
#undef BUFFERSIZE
3-
#undef TCP_NODELAY
4-
#undef TCP_KEEPALIVE
5-
61
/* Before version 7.17.0, strings were not copied.
72
Instead the user was forced keep them available
83
until libcurl no longer needed them.
@@ -30,11 +25,45 @@
3025
# define LCURL_DEFAULT_VALUE 0
3126
#endif
3227

28+
//{ Reset system macros
29+
3330
#ifdef TCP_FASTOPEN
3431
# define LCURL__TCP_FASTOPEN TCP_FASTOPEN
3532
# undef TCP_FASTOPEN
3633
#endif
3734

35+
#ifdef TCP_KEEPIDLE
36+
# define LCURL__TCP_KEEPIDLE TCP_KEEPIDLE
37+
# undef TCP_KEEPIDLE
38+
#endif
39+
40+
#ifdef TCP_KEEPINTVL
41+
# define LCURL__TCP_KEEPINTVL TCP_KEEPINTVL
42+
# undef TCP_KEEPINTVL
43+
#endif
44+
45+
#ifdef TCP_NODELAY
46+
# define LCURL__TCP_NODELAY TCP_NODELAY
47+
# undef TCP_NODELAY
48+
#endif
49+
50+
#ifdef TCP_KEEPALIVE
51+
# define LCURL__TCP_KEEPALIVE TCP_KEEPALIVE
52+
# undef TCP_KEEPALIVE
53+
#endif
54+
55+
#ifdef BUFFERSIZE
56+
# define LCURL__BUFFERSIZE BUFFERSIZE
57+
# undef BUFFERSIZE
58+
#endif
59+
60+
#ifdef INTERFACE
61+
# define LCURL__INTERFACE INTERFACE
62+
# undef INTERFACE
63+
#endif
64+
65+
//}
66+
3867
OPT_ENTRY( verbose, VERBOSE, LNG, 0, LCURL_DEFAULT_VALUE )
3968
OPT_ENTRY( header, HEADER, LNG, 0, LCURL_DEFAULT_VALUE )
4069
OPT_ENTRY( noprogress, NOPROGRESS, LNG, 0, 1 )
@@ -410,11 +439,45 @@ OPT_ENTRY( happy_eyeballs_timeout_ms,HAPPY_EYEBALLS_TIMEOUT_MS,LNG, 0, CURL_HET_
410439
OPT_ENTRY( timevalue_large, TIMEVALUE_LARGE ,OFF, 0, LCURL_DEFAULT_VALUE)
411440
#endif
412441

442+
//{ Restore system macros
443+
413444
#ifdef LCURL__TCP_FASTOPEN
414445
# define TCP_FASTOPEN LCURL__TCP_FASTOPEN
415446
# undef LCURL__TCP_FASTOPEN
416447
#endif
417448

449+
#ifdef LCURL__TCP_KEEPIDLE
450+
# define TCP_KEEPIDLE LCURL__TCP_KEEPIDLE
451+
# undef LCURL__TCP_KEEPIDLE
452+
#endif
453+
454+
#ifdef LCURL__TCP_KEEPINTVL
455+
# define TCP_KEEPINTVL LCURL__TCP_KEEPINTVL
456+
# undef LCURL__TCP_KEEPINTVL
457+
#endif
458+
459+
#ifdef LCURL__TCP_NODELAY
460+
# define TCP_NODELAY LCURL__TCP_NODELAY
461+
# undef LCURL__TCP_NODELAY
462+
#endif
463+
464+
#ifdef LCURL__TCP_KEEPALIVE
465+
# define TCP_KEEPALIVE LCURL__TCP_KEEPALIVE
466+
# undef LCURL__TCP_KEEPALIVE
467+
#endif
468+
469+
#ifdef LCURL__BUFFERSIZE
470+
# define BUFFERSIZE LCURL__BUFFERSIZE
471+
# undef LCURL__BUFFERSIZE
472+
#endif
473+
474+
#ifdef LCURL__INTERFACE
475+
# define INTERFACE LCURL__INTERFACE
476+
# undef LCURL__INTERFACE
477+
#endif
478+
479+
//}
480+
418481
#ifdef OPT_ENTRY_IS_NULL
419482
# undef OPT_ENTRY
420483
#endif

0 commit comments

Comments
 (0)