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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
From 9d0d006505d6c8fdf4ed9d52df1be10e16fa02d3 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Wed, 30 Sep 2020 15:06:29 +0200
Subject: [PATCH] adapt for library version 8.1.4
---
ip2location.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/ip2location.c b/ip2location.c
index 064e5a2..198410a 100644
--- a/ip2location.c
+++ b/ip2location.c
@@ -406,7 +406,7 @@ PHP_FUNCTION(ip2location_get_zipcode)
return;
}
record = IP2Location_get_zipcode(IP2LOCATION_G(ip2location_ptr), ip_address);
-#if API_VERSION_NUMERIC >= 80100
+#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104
ret = record->zip_code;
#else
ret = record->zipcode;
@@ -434,7 +434,7 @@ PHP_FUNCTION(ip2location_get_timezone)
return;
}
record = IP2Location_get_timezone(IP2LOCATION_G(ip2location_ptr), ip_address);
-#if API_VERSION_NUMERIC >= 80100
+#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104
ret = record->time_zone;
#else
ret = record->timezone;
@@ -469,7 +469,7 @@ PHP_FUNCTION(ip2location_get_netspeed)
}
record = IP2Location_get_netspeed(IP2LOCATION_G(ip2location_ptr), ip_address);
-#if API_VERSION_NUMERIC >= 80100
+#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104
ret = record->net_speed;
#else
ret = record->netspeed;
@@ -497,7 +497,7 @@ PHP_FUNCTION(ip2location_get_iddcode)
return;
}
record = IP2Location_get_iddcode(IP2LOCATION_G(ip2location_ptr), ip_address);
-#if API_VERSION_NUMERIC >= 80100
+#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104
ret = record->idd_code;
#else
ret = record->iddcode;
@@ -525,7 +525,7 @@ PHP_FUNCTION(ip2location_get_areacode)
return;
}
record = IP2Location_get_areacode(IP2LOCATION_G(ip2location_ptr), ip_address);
-#if API_VERSION_NUMERIC >= 80100
+#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104
ret = record->area_code;
#else
ret = record->areacode;
@@ -553,7 +553,7 @@ PHP_FUNCTION(ip2location_get_weatherstationcode)
return;
}
record = IP2Location_get_weatherstationcode(IP2LOCATION_G(ip2location_ptr), ip_address);
-#if API_VERSION_NUMERIC >= 80100
+#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104
ret = record->weather_station_code;
#else
ret = record->weatherstationcode;
@@ -581,7 +581,7 @@ PHP_FUNCTION(ip2location_get_weatherstationname)
return;
}
record = IP2Location_get_weatherstationname(IP2LOCATION_G(ip2location_ptr), ip_address);
-#if API_VERSION_NUMERIC >= 80100
+#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104
ret = record->weather_station_name;
#else
ret = record->weatherstationname;
@@ -655,7 +655,7 @@ PHP_FUNCTION(ip2location_get_mobilebrand)
return;
}
record = IP2Location_get_mobilebrand(IP2LOCATION_G(ip2location_ptr), ip_address);
-#if API_VERSION_NUMERIC >= 80100
+#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104
ret = record->mobile_brand;
#else
ret = record->mobilebrand;
@@ -702,7 +702,7 @@ PHP_FUNCTION(ip2location_get_usagetype)
return;
}
record = IP2Location_get_usagetype(IP2LOCATION_G(ip2location_ptr), ip_address);
-#if API_VERSION_NUMERIC >= 80100
+#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104
ret = record->usage_type;
#else
ret = record->usagetype;
@@ -738,7 +738,7 @@ PHP_FUNCTION(ip2location_get_all)
add_assoc_string(return_value, "city",record->city);
add_assoc_string(return_value, "isp",record->isp);
add_assoc_string(return_value, "domain",record->domain);
-#if API_VERSION_NUMERIC >= 80100
+#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104
add_assoc_string(return_value, "zipcode",record->zip_code);
add_assoc_string(return_value, "timezone",record->time_zone);
add_assoc_string(return_value, "netspeed",record->net_speed);
@@ -768,7 +768,7 @@ PHP_FUNCTION(ip2location_get_all)
add_assoc_string(return_value, "city",record->city, 1);
add_assoc_string(return_value, "isp",record->isp, 1);
add_assoc_string(return_value, "domain",record->domain, 1);
-#if API_VERSION_NUMERIC >= 80100
+#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104
add_assoc_string(return_value, "zipcode",record->zip_code, 1);
add_assoc_string(return_value, "timezone",record->time_zone, 1);
add_assoc_string(return_value, "netspeed",record->net_speed, 1);
|