blob: 2fecfce621a8a4999f0e5e632a2d5ed6c0bc71a7 (
plain)
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
|
curl-7.50.2 introduced a #define without integer value:
#ifdef CURL_NO_OLDIES
#define CURL_STRICTER
#endif
Heuristics in 'Makefile.PL' assumes all defines in form of
#define CURL_<something> <an-expression>
and generates a symbol lookup table in 'curlopt-constants.c'
as:
static int
constant(const char *name)
{
errno = 0;
if (strncmp(name, "CURL_", 5) == 0) {
name += 5;
switch (*name) {
...
case 'S':
if (strEQ(name, "STRICTER")) return CURL_STRICTER;
Which is not valid C:
curlopt-constants.c:128:49: error: ‘CURL_STRICTER’ undeclared (first use in this function)
if (strEQ(name, "STRICTER")) return CURL_STRICTER;
^~~~~~~~~~~~~
diff --git a/Makefile.PL b/Makefile.PL
index f9170bb..fc1a55a 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -122,2 +122,9 @@ if (!defined($curl_h)) {
while(<H>) {
+ # Skip defines without values like:
+ # #define CURL_STRICTER
+ if (/^#define (CURL[A-Za-z0-9_]*)$/) {
+ chomp;
+ warn "Skipping '$_': does not define a symbol";
+ next;
+ }
if (/^#define (CURL[A-Za-z0-9_]*)/) {
|