c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrewsdiff -ruN dists/GeoIP-1.5.1/libGeoIP/GeoIP.c dev/GeoIP-1.5.1/libGeoIP/GeoIP.c
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews--- dists/GeoIP-1.5.1/libGeoIP/GeoIP.c 2013-03-23 03:26:09.000000000 +0100
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+++ dev/GeoIP-1.5.1/libGeoIP/GeoIP.c 2013-07-19 16:56:58.000000000 +0200
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews@@ -19,6 +19,7 @@
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews static geoipv6_t IPV6_NULL;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews@@ -44,6 +45,10 @@
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews #include <stdint.h> /* For uint32_t */
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+#if defined(_WIN32)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews #ifdef _UNUSED
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews #elif defined(__GNUC__)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews #define _UNUSED __attribute__ ((unused))
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrewsdiff -ruN dists/GeoIP-1.5.1/libGeoIP/GeoIP.h dev/GeoIP-1.5.1/libGeoIP/GeoIP.h
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews--- dists/GeoIP-1.5.1/libGeoIP/GeoIP.h 2013-03-23 03:26:09.000000000 +0100
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+++ dev/GeoIP-1.5.1/libGeoIP/GeoIP.h 2013-07-19 16:53:33.000000000 +0200
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews@@ -154,31 +154,33 @@
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews GEOIP_CORPORATE_SPEED = 3,
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews } GeoIPNetspeedValues;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+#ifdef GEOIP_EXPORTS
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+#define GEOIP_API __declspec(dllexport)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+#define GEOIP_DATA __declspec(dllexport)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+#define GEOIP_DATA __declspec(dllimport)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+#define GEOIP_API
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+#endif /* GEOIP_EXPORTS */
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews extern char **GeoIPDBFileName;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-extern const char * GeoIPDBDescription[NUM_DB_TYPES];
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-extern const char *GeoIPCountryDBFileName;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-extern const char *GeoIPRegionDBFileName;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-extern const char *GeoIPCityDBFileName;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-extern const char *GeoIPOrgDBFileName;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-extern const char *GeoIPISPDBFileName;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-extern const char *GeoIPLocationADBFileName;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-extern const char *GeoIPAccuracyRadiusFileName;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-extern const char *GeoIPCityConfidenceFileName;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+extern GEOIP_DATA const char * GeoIPDBDescription[NUM_DB_TYPES];
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+extern GEOIP_DATA const char *GeoIPCountryDBFileName;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+extern GEOIP_DATA const char *GeoIPRegionDBFileName;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+extern GEOIP_DATA const char *GeoIPCityDBFileName;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+extern GEOIP_DATA const char *GeoIPOrgDBFileName;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+extern GEOIP_DATA const char *GeoIPISPDBFileName;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+extern GEOIP_DATA const char *GeoIPLocationADBFileName;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+extern GEOIP_DATA const char *GeoIPAccuracyRadiusFileName;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+extern GEOIP_DATA const char *GeoIPCityConfidenceFileName;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews extern char * GeoIP_custom_directory;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews /* Warning: do not use those arrays as doing so may break your
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews * program with newer GeoIP versions */
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-extern const char GeoIP_country_code[255][3];
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-extern const char GeoIP_country_code3[255][4];
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-extern const char * GeoIP_country_name[255];
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-extern const char * GeoIP_utf8_country_name[255];
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-extern const char GeoIP_country_continent[255][3];
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-#define GEOIP_API __declspec(dllexport)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-#define GEOIP_API
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-#endif /* DLL */
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+extern GEOIP_DATA const char GeoIP_country_code[255][3];
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+extern GEOIP_DATA const char GeoIP_country_code3[255][4];
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+extern GEOIP_DATA const char * GeoIP_country_name[255];
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+extern GEOIP_DATA const char * GeoIP_utf8_country_name[255];
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+extern GEOIP_DATA const char GeoIP_country_continent[255][3];
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews GEOIP_API void GeoIP_setup_custom_directory(char *dir);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews GEOIP_API GeoIP* GeoIP_open_type (int type, int flags);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrewsdiff -ruN dists/GeoIP-1.5.1/libGeoIP/GeoIPCity.c dev/GeoIP-1.5.1/libGeoIP/GeoIPCity.c
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews--- dists/GeoIP-1.5.1/libGeoIP/GeoIPCity.c 2013-03-23 03:26:09.000000000 +0100
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+++ dev/GeoIP-1.5.1/libGeoIP/GeoIPCity.c 2013-07-19 15:41:05.000000000 +0200
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews@@ -35,6 +35,10 @@
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews #include <stdint.h> /* For uint32_t */
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+#if defined(_WIN32)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews #ifndef HAVE_PREAD
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews #define pread(fd, buf, count, offset) \
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrewsdiff -ruN dists/GeoIP-1.5.1/libGeoIP/GeoIPCity.h dev/GeoIP-1.5.1/libGeoIP/GeoIPCity.h
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews--- dists/GeoIP-1.5.1/libGeoIP/GeoIPCity.h 2013-03-23 03:26:09.000000000 +0100
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+++ dev/GeoIP-1.5.1/libGeoIP/GeoIPCity.h 2013-07-19 16:23:58.000000000 +0200
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews@@ -48,22 +48,22 @@
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews int netmask;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews } GeoIPRecord;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-GeoIPRecord * GeoIP_record_by_ipnum (GeoIP* gi, unsigned long ipnum);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-GeoIPRecord * GeoIP_record_by_addr (GeoIP* gi, const char *addr);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-GeoIPRecord * GeoIP_record_by_name (GeoIP* gi, const char *host);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-GeoIPRecord * GeoIP_record_by_ipnum_v6 (GeoIP* gi, geoipv6_t ipnum);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-GeoIPRecord * GeoIP_record_by_addr_v6 (GeoIP* gi, const char *addr);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-GeoIPRecord * GeoIP_record_by_name_v6 (GeoIP* gi, const char *host);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+GEOIP_API GeoIPRecord * GeoIP_record_by_ipnum (GeoIP* gi, unsigned long ipnum);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+GEOIP_API GeoIPRecord * GeoIP_record_by_addr (GeoIP* gi, const char *addr);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+GEOIP_API GeoIPRecord * GeoIP_record_by_name (GeoIP* gi, const char *host);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+GEOIP_API GeoIPRecord * GeoIP_record_by_ipnum_v6 (GeoIP* gi, geoipv6_t ipnum);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+GEOIP_API GeoIPRecord * GeoIP_record_by_addr_v6 (GeoIP* gi, const char *addr);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+GEOIP_API GeoIPRecord * GeoIP_record_by_name_v6 (GeoIP* gi, const char *host);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-int GeoIP_record_id_by_addr (GeoIP* gi, const char *addr);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-int GeoIP_record_id_by_addr_v6 (GeoIP* gi, const char *addr);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+GEOIP_API int GeoIP_record_id_by_addr (GeoIP* gi, const char *addr);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+GEOIP_API int GeoIP_record_id_by_addr_v6 (GeoIP* gi, const char *addr);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-int GeoIP_init_record_iter (GeoIP* gi);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+GEOIP_API int GeoIP_init_record_iter (GeoIP* gi);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews /* returns 0 on success, 1 on failure */
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-int GeoIP_next_record (GeoIP* gi, GeoIPRecord **gir, int *record_iter);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+GEOIP_API int GeoIP_next_record (GeoIP* gi, GeoIPRecord **gir, int *record_iter);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-void GeoIPRecord_delete (GeoIPRecord *gir);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+GEOIP_API void GeoIPRecord_delete (GeoIPRecord *gir);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews /* NULL on failure otherwise a malloced string in utf8 */
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews /* char * GeoIP_iso_8859_1__utf8(const char *); */
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrewsdiff -ruN dists/GeoIP-1.5.1/libGeoIP/Makefile.vc dev/GeoIP-1.5.1/libGeoIP/Makefile.vc
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews--- dists/GeoIP-1.5.1/libGeoIP/Makefile.vc 2013-03-23 03:26:09.000000000 +0100
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+++ dev/GeoIP-1.5.1/libGeoIP/Makefile.vc 2013-07-19 16:47:45.000000000 +0200
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews@@ -1,29 +1,42 @@
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews #NMAKE makefile for Windows developers.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-#Produces a static library (GeoIP.lib).
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+##Produces a static library (GeoIP.lib).
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+#Produces a DLL (GeoIP.dll) and library (GeoIP.lib).
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-CFLAGS=-DWIN32 -MD -nologo
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+CFLAGS=-DWIN32 -DGEOIP_EXPORTS -MD -nologo
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews GEOIPINC = -I..\libGeoIP
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-CC1 = $(COMPILER) $(CFLAGS) $(GEOIPINC) -DGEOIPDATADIR=\"$(GEOIPDATADIR)\"
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+CC1 = $(COMPILER) $(CFLAGS) $(GEOIPINC) -DGEOIPDATADIR=\"$(GEOIPDATADIR)\" -DPACKAGE_VERSION=\"1.5.1\"
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-OBJS=GeoIP.obj GeoIPCity.obj regionName.obj md5.obj timeZone.obj
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+LDFLAGS=/DLL /nologo /subsystem:console
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+LD1 = $(LINKER) $(LDFLAGS)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+OBJS=GeoIP.obj GeoIPCity.obj GeoIP_depreciated.obj regionName.obj md5.obj timeZone.obj pread.obj
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-GeoIP.lib: GeoIP.obj GeoIPCity.obj regionName.obj md5.obj timeZone.obj
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews- $(AR) -nologo $(OBJS) $(EXTRA_LIBS) /OUT:GeoIP.lib
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+#GeoIP.lib: GeoIP.obj GeoIPCity.obj regionName.obj md5.obj timeZone.obj pread.obj
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+# $(AR) -nologo $(OBJS) $(EXTRA_LIBS) /OUT:GeoIP.lib
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ $(LD1) $(OBJS) $(EXTRA_LIBS) /out:GeoIP.dll /implib:GeoIP.lib
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(CC1) -c GeoIP.c $(GEOIPINC)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(CC1) -c GeoIPCity.c $(GEOIPINC)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ $(CC1) -c GeoIP_depreciated.c $(GEOIPINC)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(CC1) -c regionName.c $(GEOIPINC)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews@@ -32,3 +45,6 @@
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(CC1) -c timeZone.c $(GEOIPINC)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ $(CC1) -c pread.c $(GEOIPINC)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrewsdiff -ruN dists/GeoIP-1.5.1/libGeoIP/pread.c dev/GeoIP-1.5.1/libGeoIP/pread.c
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews--- dists/GeoIP-1.5.1/libGeoIP/pread.c 1970-01-01 01:00:00.000000000 +0100
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+++ dev/GeoIP-1.5.1/libGeoIP/pread.c 2013-07-19 15:37:44.000000000 +0200
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews@@ -0,0 +1,73 @@
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * Permission to use, copy, modify, and/or distribute this software for any
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * purpose with or without fee is hereby granted, provided that the above
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * copyright notice and this permission notice appear in all copies.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * PERFORMANCE OF THIS SOFTWARE.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+CRITICAL_SECTION preadsc;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+#ifdef _WIN64
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+int pread(int fd, void *buf, unsigned int nbyte, __int64 offset)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ int cc = -1;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ __int64 prev = (__int64)-1L;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ EnterCriticalSection(&preadsc);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ prev = _lseeki64(fd, 0L, SEEK_CUR);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ if (prev == (__int64)-1L)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ if (_lseeki64(fd, offset, SEEK_SET) != offset)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ cc = _read(fd, buf, nbyte);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ if (prev != (__int64)-1L)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ (void)_lseeki64(fd, prev, SEEK_SET);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ LeaveCriticalSection(&preadsc);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+int pread(int fd, void *buf, unsigned int nbyte, long offset)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ int cc = -1;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ long prev = -1L;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ EnterCriticalSection(&preadsc);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ prev = _lseek(fd, 0L, SEEK_CUR);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ if (prev == -1L)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ if (_lseek(fd, offset, SEEK_SET) != offset)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ cc = _read(fd, buf, nbyte);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ if (prev != -1L)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ (void)_lseek(fd, prev, SEEK_SET);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ LeaveCriticalSection(&preadsc);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved )
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ if (fdwReason == DLL_PROCESS_ATTACH)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ InitializeCriticalSection(&preadsc);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ return TRUE;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrewsdiff -ruN dists/GeoIP-1.5.1/libGeoIP/pread.h dev/GeoIP-1.5.1/libGeoIP/pread.h
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews--- dists/GeoIP-1.5.1/libGeoIP/pread.h 1970-01-01 01:00:00.000000000 +0100
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+++ dev/GeoIP-1.5.1/libGeoIP/pread.h 2013-07-19 15:39:01.000000000 +0200
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews@@ -0,0 +1,29 @@
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * Permission to use, copy, modify, and/or distribute this software for any
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * purpose with or without fee is hereby granted, provided that the above
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * copyright notice and this permission notice appear in all copies.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ * PERFORMANCE OF THIS SOFTWARE.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+#ifdef _WIN64
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+typedef __int64 ssize_t;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+int pread(int fd, void *buf, unsigned int nbyte, __int64 offset);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+typedef int ssize_t;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+int pread(int fd, void *buf, unsigned int nbyte, long offset);
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+#define HAVE_PREAD
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+extern CRITICAL_SECTION preadsc;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrewsdiff -ruN dists/GeoIP-1.5.1/libGeoIP/regionName.c dev/GeoIP-1.5.1/libGeoIP/regionName.c
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews--- dists/GeoIP-1.5.1/libGeoIP/regionName.c 2013-03-23 03:26:09.000000000 +0100
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+++ dev/GeoIP-1.5.1/libGeoIP/regionName.c 2013-07-19 16:37:56.000000000 +0200
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews@@ -1,3 +1,5 @@
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrewsdiff -ruN dists/GeoIP-1.5.1/libGeoIP/timeZone.c dev/GeoIP-1.5.1/libGeoIP/timeZone.c
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews--- dists/GeoIP-1.5.1/libGeoIP/timeZone.c 2013-03-23 03:26:09.000000000 +0100
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+++ dev/GeoIP-1.5.1/libGeoIP/timeZone.c 2013-07-19 17:22:44.000000000 +0200
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews@@ -1,4 +1,7 @@
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews const char* GeoIP_time_zone_by_country_and_region(const char * country,const char * region) {
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews const char* timezone = NULL;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews if (country == NULL) {
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrewsdiff -ruN dists/GeoIP-1.5.1/test/Makefile.vc dev/GeoIP-1.5.1/test/Makefile.vc
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews--- dists/GeoIP-1.5.1/test/Makefile.vc 2013-03-23 03:26:09.000000000 +0100
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+++ dev/GeoIP-1.5.1/test/Makefile.vc 2013-07-19 16:48:55.000000000 +0200
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews@@ -9,7 +9,7 @@
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews GEOIPINC = -I..\libGeoIP
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews-CC1 = $(COMPILER) $(CFLAGS) $(GEOIPINC)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+CC1 = $(COMPILER) $(CFLAGS) $(GEOIPINC) -DSRCDIR=\"../\"
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews GEOIPLIB = ..\libGeoIP\GeoIP.lib
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrewsdiff -ruN dists/GeoIP-1.5.1/test/benchmark.c dev/GeoIP-1.5.1/test/benchmark.c
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews--- dists/GeoIP-1.5.1/test/benchmark.c 2013-03-23 03:26:09.000000000 +0100
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+++ dev/GeoIP-1.5.1/test/benchmark.c 2013-07-19 16:26:23.000000000 +0200
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews@@ -81,7 +81,7 @@
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews void testgeoiporg(int flags, const char *msg, int numlookups)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews GeoIP *i = NULL;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews- GeoIPRegion *i3 = NULL;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews+ char *i3 = NULL;
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews double t = 0;