1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2026-05-01 00:07:19 +02:00

Update libraries and make it build on windows.

Still gets some warnings because compilers have changed. But should work.
This commit is contained in:
Sandu Liviu Catalin
2025-06-25 22:34:23 +03:00
parent 520a5eacc5
commit f2b7499f85
3038 changed files with 251668 additions and 273857 deletions
+10 -4
View File
@@ -2,6 +2,8 @@ name: "Code scanning - action"
on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
schedule:
- cron: '0 7 * * 2'
@@ -11,14 +13,18 @@ jobs:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
submodules: true
persist-credentials: false
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
@@ -27,9 +33,9 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
- run: sudo apt install libipc-run3-perl libfile-slurp-perl libfile-which-perl pandoc
- run: sudo apt install libipc-run3-perl pandoc
- run: |
./bootstrap
./configure
@@ -37,4 +43,4 @@ jobs:
make safedist
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
+5 -3
View File
@@ -17,9 +17,10 @@ jobs:
CC: ${{ matrix.cc }}
VERBOSE: 1
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
persist-credentials: false
- run: sudo apt install libipc-run3-perl
if: ${{ matrix.os == 'ubuntu-latest' }}
- run: brew install autoconf automake libtool
@@ -38,9 +39,10 @@ jobs:
name: CMake build on ${{matrix.os}}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
persist-credentials: false
- run: cmake -DBUILD_TESTING=ON .
- run: cmake --build .
- run: ctest -V .
- run: ctest -V . -C Debug
+2
View File
@@ -18,6 +18,7 @@
/config.*
/configure
/depcomp
/generated
/include/maxminddb_config.h
/install-sh
/libmaxminddb-*
@@ -43,3 +44,4 @@ Makefile
Makefile.in
Testing/
install_manifest.txt
build/
+78 -14
View File
@@ -1,8 +1,8 @@
cmake_minimum_required (VERSION 3.9)
cmake_minimum_required (VERSION 3.9...3.30)
project(maxminddb
LANGUAGES C
VERSION 1.6.0
VERSION 1.12.2
)
set(MAXMINDDB_SOVERSION 0.0.7)
set(CMAKE_C_STANDARD 99)
@@ -13,6 +13,11 @@ if (WIN32)
endif()
option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF)
option(BUILD_TESTING "Build test programs" ON)
option(BUILD_FUZZING "Build with fuzzer" OFF)
option(MAXMINDDB_BUILD_BINARIES "Build binaries" ON)
option(MAXMINDDB_INSTALL "Generate the install target" ON)
include(GNUInstallDirs)
include(CheckTypeSize)
check_type_size("unsigned __int128" UINT128)
@@ -35,8 +40,8 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
configure_file(${PROJECT_SOURCE_DIR}/include/maxminddb_config.h.cmake.in
${PROJECT_SOURCE_DIR}/include/maxminddb_config.h)
configure_file(${PROJECT_SOURCE_DIR}/include/maxminddb_config.h.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/generated/maxminddb_config.h)
add_library(maxminddb
src/maxminddb.c
@@ -46,7 +51,7 @@ add_library(maxminddb::maxminddb ALIAS maxminddb)
set_target_properties(maxminddb PROPERTIES VERSION ${MAXMINDDB_SOVERSION})
target_compile_definitions(maxminddb PUBLIC PACKAGE_VERSION="${PROJECT_VERSION}")
target_compile_definitions(maxminddb PRIVATE PACKAGE_VERSION="${PROJECT_VERSION}")
if(NOT IS_BIG_ENDIAN)
target_compile_definitions(maxminddb PRIVATE MMDB_LITTLE_ENDIAN=1)
@@ -77,28 +82,87 @@ endif()
target_include_directories(maxminddb PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/generated/>
$<INSTALL_INTERFACE:include>
)
set(MAXMINDB_HEADERS
include/maxminddb.h
include/maxminddb_config.h
${CMAKE_CURRENT_BINARY_DIR}/generated/maxminddb_config.h
)
set_target_properties(maxminddb PROPERTIES PUBLIC_HEADER "${MAXMINDB_HEADERS}")
#install(TARGETS maxminddb EXPORT maxminddb)
if (MAXMINDDB_INSTALL)
install(TARGETS maxminddb
EXPORT maxminddb)
# This is required to work with FetchContent
# install(EXPORT maxminddb
# FILE maxminddb-config.cmake
# NAMESPACE maxminddb::
# DESTINATION lib/cmake/maxminddb)
# This is required to work with FetchContent
install(EXPORT maxminddb
FILE maxminddb-config.cmake
NAMESPACE maxminddb::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/maxminddb)
endif()
# We always want to build mmdblookup
#add_subdirectory(bin)
if (MAXMINDDB_BUILD_BINARIES)
add_subdirectory(bin)
endif()
# Check if man pages exist, if not, generate them
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/man")
find_program(PERL perl)
if(PERL)
message(STATUS "Generating man pages")
execute_process(
COMMAND ${PERL} ${CMAKE_CURRENT_SOURCE_DIR}/dev-bin/make-man-pages.pl
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
else()
message(WARNING "Perl not found. Unable to generate man pages.")
endif()
endif()
# Install man pages if they exist
if(MAXMINDDB_INSTALL AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/man")
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/man/man1
DESTINATION ${CMAKE_INSTALL_MANDIR}
)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/man/man3
DESTINATION ${CMAKE_INSTALL_MANDIR}
)
endif()
if (BUILD_TESTING)
enable_testing()
add_subdirectory(t)
endif()
# Generate libmaxminddb.pc file for pkg-config
# Set the required variables as same with autotools
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
set(libdir ${CMAKE_INSTALL_LIBDIR})
set(includedir ${CMAKE_INSTALL_INCLUDEDIR})
set(PACKAGE_VERSION ${maxminddb_VERSION})
if (MAXMINDDB_INSTALL)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/libmaxminddb.pc.in
${CMAKE_CURRENT_BINARY_DIR}/src/libmaxminddb.pc
@ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/src/libmaxminddb.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
# uninstall target
# if(NOT TARGET uninstall)
# configure_file(
# "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
# "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
# IMMEDIATE @ONLY)
# add_custom_target(uninstall
# COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
# endif()
+97 -2
View File
@@ -1,4 +1,94 @@
## 1.7.0
## 1.12.2 - 2025-01-10
* `MMDB_get_entry_data_list()` now always sets the passed `entry_data_list`
parameter to either `NULL` or valid memory. This makes it safe for
callers to use `MMDB_free_entry_data_list()` on it even in case of error.
In 1.12.0 `MMDB_get_entry_data_list()` was changed to not set this
parameter to valid memory in additional error cases. That change caused
segfaults for certain libraries that assumed it was safe to free memory
on error. Doing so was never safe, but worked in some cases. This change
makes such calls safe. Reported by Petr Pisar. GitHub
maxmind/MaxMind-DB-Reader-XS#39.
## 1.12.1 - 2025-01-08
* Added missing `cmake_uninstall.cmake.in` to the source distribution. This
was missing from 1.12.0, causing CMake builds to fail. Reported by Marcel
Raad. GitHub #367.
## 1.12.0 - 2025-01-07
* Fixed memory leaks in `MMDB_open()`. These could happen with invalid
databases or in error situations such as failing to allocate memory. As
part of the fix, `MMDB_get_entry_data_list()` now frees memory it
allocates on additional errors. Previously it failed to clean up when
certain errors occurred. Pull request by pkillarjun. GitHub #356.
* There is now a build target to fuzz the library. Pull request by
pkillarjun. GitHub #357.
* Updated `cmake_minimum_required` to a version range to quiet deprecation
warnings on new CMake versions. Reported by gmou3. GitHub #359.
* The script for generating man pages no longer uses `autodie`. This
eliminates the dependency on `IPC::System::Simple`. Reported by gmou3.
GitHub #359.
* An uninstall target is now included for CMake. Pull request by gmou3.
GitHub #362.
## 1.11.0 - 2024-08-21
* When building with CMake, the man pages will now be generated and
installed. Requested by Thomas Klausner. GitHub #351.
* Removed unnecessary `$<INSTALL_INTERFACE:generated>` directory from
`target_include_directories` in the CMake build configuration. This is
a private build directory. Pull request by Ankur Verma. GitHub #354.
## 1.10.0 - 2024-06-10
* When building with CMake, it is now possible to disable the building
of binaries (e.g., `mmdblookup`) with the `MAXMINDDB_BUILD_BINARIES`
option and the install target generation with the `MAXMINDDB_INSTALL`
option. Pull request by Seena Fallah. GitHub #342.
* CMake now makes greater use of GNUInstallDirs. Pull request by Maximilian
Downey Twiss. GitHub #346.
* The reader can now look up records on a database with a search tree
that is greater than 4 gigabytes without sometimes returning erroneous
results due to an integer overflow.
## 1.9.1 - 2024-01-09
* `SSIZE_MAX` is now defined conditionally on Windows. The 1.9.0
release would cause a redefinition warning when compiled with MinGW.
Reported by Andreas Vögele. GitHub #338.
## 1.9.0 - 2024-01-09
* On very large databases, the calculation to determine the search tree
size could overflow. This was fixed and several additional guards
against overflows were added. Reported by Sami Salonen. GitHub #335.
* Removed `sa_family_t` typedef from the public header on Windows. Pull
request by Noah Treuhaft. GitHub #334.
* The CMake build was adjusted to allow running builds in parallel.
Pull request by Vladyslav Miachkov. GitHub #332.
## 1.8.0 - 2023-11-07
* `PACKAGE_VERSION` is now a private compile definition when building
with CMake. Pull request by bsergean. GitHub #308.
* `PACKAGE_VERSION` is no longer defined in `maxminddb.h` on
Windows.
* The feature test macro `_POSIX_C_SOURCE` is no longer set by
`maxminddb.h`. As discussed in GitHub #318, this should be set by
applications rather than by libraries.
* `assert()` is no longer used outside test code.
* The deprecated Visual Studio 12 project files in the `projects/`
directory have been removed. CMake should be used when building on
Windows.
## 1.7.1 - 2022-09-30
* The external symbols test now only runs on Linux. It assumes a Linux
environment. Reported by Carlo Cabrera. GitHub #304.
## 1.7.0 - 2022-09-28
* `FD_CLOEXEC` is now set on platforms that do not support `O_CLOEXEC`.
Reported by rittneje. GitHub #273.
@@ -6,6 +96,11 @@
CMake by setting `MSVC_STATIC_RUNTIME` to `ON`. Pull request by Rafael
Santiago. GitHub #269.
* The CMake build now works on iOS. Pull request by SpaceIm. GitHub #271.
* The CMake build now uses the correct library directory on Linux systems
using alternate directory structures. Pull request by Satadru Pramanik.
GitHub #284.
* File size check now correctly compares the size to `SSIZE_MAX`. Reported
by marakew. GitHub #301.
## 1.6.0 - 2021-04-29
@@ -190,7 +285,7 @@
code to think it had found valid metadata when none existed. In addition,
this could lead to an attempt to read past the end of the database
entirely. Finally, if there are multiple metadata markers in the database,
we treat the final one as the start of the metdata, instead of the first.
we treat the final one as the start of the metadata, instead of the first.
Implemented by Tobias Stoeckmann. GitHub #102.
* Don't attempt to mmap a file that is too large to be mmapped on the
system. Implemented by Tobias Stoeckmann. GitHub #101.
+2 -2
View File
@@ -16,9 +16,9 @@ SUBDIRS += \
t
endif
EXTRA_DIST = doc Changes.md LICENSE NOTICE README.md projects/VS12 projects/VS12-tests \
EXTRA_DIST = doc Changes.md LICENSE NOTICE README.md \
CMakeLists.txt t/CMakeLists.txt bin/CMakeLists.txt \
include/maxminddb_config.h.cmake.in
cmake_uninstall.cmake.in include/maxminddb_config.h.cmake.in
dist-hook:
dev-bin/make-man-pages.pl $(distdir)
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright 2013-2021 MaxMind, Inc.
Copyright 2013-2025 MaxMind, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
+1 -2
View File
@@ -52,8 +52,7 @@ some reason.
autoconf automake libtool git-buildpackage libfile-slurp-perl pandoc
dirmngr libfile-slurp-tiny-perl libdatetime-perl debhelper dh-autoreconf
libipc-run3-perl libtest-output-perl devscripts
* Install [hub](https://github.com/github/hub/releases). (Using `./install`
from the tarball is fine)
* Install [gh](https://github.com/cli/cli/releases).
* GitHub ssh key (e.g. in `~/.ssh/id_rsa`)
* Git config (e.g. `~/.gitconfig`)
* Import your GPG secret key (or create one if you don't have a suitable
+41
View File
@@ -0,0 +1,41 @@
# Fuzzing libmaxminddb
These tests are only meant to be run on GNU/Linux.
## Build maxminddb fuzzer using libFuzzer.
### Export flags for fuzzing.
Note that in `CFLAGS` and `CXXFLAGS`, any type of sanitizers can be added.
- [AddressSanitizer](https://clang.llvm.org/docs/AddressSanitizer.html),
[ThreadSanitizer](https://clang.llvm.org/docs/ThreadSanitizer.html),
[MemorySanitizer](https://clang.llvm.org/docs/MemorySanitizer.html),
[UndefinedBehaviorSanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html),
[LeakSanitizer](https://clang.llvm.org/docs/LeakSanitizer.html).
```shell
$ export CC=clang
$ export CXX=clang++
$ export CFLAGS="-g -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address,undefined -fsanitize=fuzzer-no-link"
$ export CXXFLAGS="-g -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address,undefined -fsanitize=fuzzer-no-link"
$ export LIB_FUZZING_ENGINE="-fsanitize=fuzzer"
```
### Build maxminddb for fuzzing.
```shell
$ mkdir -p build && cd build
$ cmake -DBUILD_FUZZING=ON ../.
$ cmake --build . -j$(nproc)
```
### Running fuzzer.
```shell
$ mkdir -p fuzz_mmdb_seed fuzz_mmdb_seed_corpus
$ find ../t/maxmind-db/test-data/ -type f -size -4k -exec cp {} ./fuzz_mmdb_seed_corpus/ \;
$ ./t/fuzz_mmdb fuzz_mmdb_seed/ fuzz_mmdb_seed_corpus/
```
Here is more information about [LibFuzzer](https://llvm.org/docs/LibFuzzer.html).
+58 -34
View File
@@ -6,10 +6,10 @@ designed to facilitate fast lookups of IP addresses while allowing for great
flexibility in the type of data associated with an address.
The MaxMind DB format is an open format. The spec is available at
http://maxmind.github.io/MaxMind-DB/. This spec is licensed under the Creative
Commons Attribution-ShareAlike 3.0 Unported License.
https://maxmind.github.io/MaxMind-DB/. This spec is licensed under the
Creative Commons Attribution-ShareAlike 3.0 Unported License.
See http://dev.maxmind.com/ for more details about MaxMind's GeoIP2 products.
See https://dev.maxmind.com/ for more details about MaxMind's GeoIP2 products.
# License
@@ -30,11 +30,13 @@ structure.
To install this code, run the following commands:
$ ./configure
$ make
$ make check
$ sudo make install
$ sudo ldconfig
```bash
./configure
make
make check
sudo make install
sudo ldconfig
```
You can skip the `make check` step but it's always good to know that tests are
passing on your platform.
@@ -47,8 +49,10 @@ you may need to add the `lib` directory in your `prefix` to your library path.
On most Linux distributions when using the default prefix (`/usr/local`), you
can do this by running the following commands:
$ sudo sh -c "echo /usr/local/lib >> /etc/ld.so.conf.d/local.conf"
$ ldconfig
```bash
sudo sh -c "echo /usr/local/lib >> /etc/ld.so.conf.d/local.conf"
ldconfig
```
## From a GitHub "Source Code" Archive / Git Repo Clone (Achtung!)
@@ -65,7 +69,9 @@ in addition to `make` and a compiler.
You can clone this repository and build it by running:
$ git clone --recursive https://github.com/maxmind/libmaxminddb
```bash
git clone --recursive https://github.com/maxmind/libmaxminddb
```
After cloning, run `./bootstrap` from the `libmaxminddb` directory and then
follow the instructions for installing from a named release tarball as
@@ -77,62 +83,80 @@ We provide a CMake build script. This is primarily targeted at Windows users,
but it can be used in other circumstances where the Autotools script does not
work.
$ cmake --build .
$ ctest -V .
$ cmake --build . --target install
```bash
cmake -B build
cd build/
cmake --build .
ctest -V .
cmake --build . --target install
```
When building with Visual Studio, you may build a multithreaded (MT/MTd)
runtime library, using the `MSVC_STATIC_RUNTIME` setting:
$ cmake -DMSVC_STATIC_RUNTIME=ON -DBUILD_SHARED_LIBS=OFF ..
```bash
cmake -DMSVC_STATIC_RUNTIME=ON -DBUILD_SHARED_LIBS=OFF ..
```
We also include a CMake `uninstall` target:
```bash
cmake --build . --target uninstall
```
## On Ubuntu via PPA
MaxMind provides a PPA for recent version of Ubuntu. To add the PPA to your
APT sources, run:
$ sudo add-apt-repository ppa:maxmind/ppa
```bash
sudo add-apt-repository ppa:maxmind/ppa
```
Then install the packages by running:
$ sudo apt update
$ sudo apt install libmaxminddb0 libmaxminddb-dev mmdb-bin
```bash
sudo apt update
sudo apt install libmaxminddb0 libmaxminddb-dev mmdb-bin
```
## On OS X via Homebrew
## On macOS via Homebrew or MacPorts
If you are on OS X and you have homebrew (see http://brew.sh/) you can install
libmaxminddb via brew.
You can install libmaxminddb on macOS using [Homebrew](https://brew.sh):
$ brew install libmaxminddb
```bash
brew install libmaxminddb
```
Or with [MacPorts](https://ports.macports.org/port/libmaxminddb):
```bash
sudo port install libmaxminddb
```
# Requirements
libmaxminddb requires a minimum of POSIX.1-2001 support. If not specified
at compilation time, it defaults to requesting POSIX.1-2008 support.
# Bug Reports
Please report bugs by filing an issue with our GitHub issue tracker at
https://github.com/maxmind/libmaxminddb/issues
# Dev Tools
We have a few development tools under the `dev-bin` directory to make
development easier. These are written in Perl or shell. They are:
* `uncrustify-all.sh` - This runs `uncrustify` on all the code. Please run
this before submitting patches.
* `valgrind-all.pl` - This runs Valgrind on the tests and `mmdblookup` to
check for memory leaks.
# Creating a Release Tarball
Use `make safedist` to check the resulting tarball.
# Copyright and License
Copyright 2013-2021 MaxMind, Inc.
Copyright 2013-2025 MaxMind, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
+16 -5
View File
@@ -1,13 +1,24 @@
# getopt is required by mmdblookup which is not available by default on Windows
if(NOT WIN32)
# but available in mingw-64 toolchain by-default.
if(NOT MSVC)
add_executable(mmdblookup
mmdblookup.c
)
# Otherwise 'undefined reference to WinMain' linker error happen due to wmain()
if(MINGW)
target_link_options(mmdblookup PRIVATE "-municode")
endif()
target_compile_definitions(mmdblookup PRIVATE PACKAGE_VERSION="${PROJECT_VERSION}")
target_link_libraries(mmdblookup maxminddb pthread)
install(
TARGETS mmdblookup
DESTINATION bin
)
if (MAXMINDDB_INSTALL)
install(
TARGETS mmdblookup
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
endif()
endif()
+4
View File
@@ -4,6 +4,10 @@ AM_LDFLAGS = $(top_builddir)/src/libmaxminddb.la
bin_PROGRAMS = mmdblookup
if WINDOWS
AM_LDFLAGS += -municode
endif
if !WINDOWS
AM_CPPFLAGS += -pthread
AM_LDFLAGS += -pthread
+40 -26
View File
@@ -1,3 +1,7 @@
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -7,6 +11,7 @@
#ifndef _WIN32
#include <pthread.h>
#endif
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@@ -139,7 +144,7 @@ int main(int argc, char **argv) {
free((void *)lookup_path);
srand((int)time(NULL));
srand((unsigned int)time(NULL));
#ifndef _WIN32
if (thread_count > 0) {
@@ -223,6 +228,14 @@ static const char **get_options(int argc,
static int help = 0;
static int version = 0;
#ifdef _WIN32
char *program = alloca(strlen(argv[0]));
_splitpath(argv[0], NULL, NULL, program, NULL);
_splitpath(argv[0], NULL, NULL, NULL, program + strlen(program));
#else
char *program = basename(argv[0]);
#endif
while (1) {
static struct option options[] = {
{"file", required_argument, 0, 'f'},
@@ -259,24 +272,24 @@ static const char **get_options(int argc,
} else if ('n' == opt_char) {
version = 1;
} else if ('b' == opt_char) {
*iterations = strtol(optarg, NULL, 10);
long const i = strtol(optarg, NULL, 10);
if (i > INT_MAX) {
usage(program, 1, "iterations exceeds maximum value");
}
*iterations = (int)i;
} else if ('h' == opt_char || '?' == opt_char) {
help = 1;
} else if (opt_char == 't') {
*thread_count = strtol(optarg, NULL, 10);
long const i = strtol(optarg, NULL, 10);
if (i > INT_MAX) {
usage(program, 1, "thread count exceeds maximum value");
}
*thread_count = (int)i;
} else if (opt_char == 'I') {
*ip_file = optarg;
}
}
#ifdef _WIN32
char *program = alloca(strlen(argv[0]));
_splitpath(argv[0], NULL, NULL, program, NULL);
_splitpath(argv[0], NULL, NULL, NULL, program + strlen(program));
#else
char *program = basename(argv[0]);
#endif
if (help) {
usage(program, 0, NULL);
}
@@ -295,7 +308,7 @@ static const char **get_options(int argc,
}
const char **lookup_path =
calloc((argc - optind) + 1, sizeof(const char *));
calloc((size_t)(argc - optind) + 1, sizeof(const char *));
if (!lookup_path) {
fprintf(stderr, "calloc(): %s\n", strerror(errno));
exit(1);
@@ -452,12 +465,12 @@ static bool lookup_from_file(MMDB_s *const mmdb,
if (dump) {
fprintf(stdout, "%s:\n", buf);
int const status =
int const status2 =
MMDB_dump_entry_data_list(stderr, entry_data_list, 0);
if (status != MMDB_SUCCESS) {
if (status2 != MMDB_SUCCESS) {
fprintf(stderr,
"MMDB_dump_entry_data_list(): %s\n",
MMDB_strerror(status));
MMDB_strerror(status2));
fclose(fh);
MMDB_free_entry_data_list(entry_data_list);
return false;
@@ -472,10 +485,10 @@ static bool lookup_from_file(MMDB_s *const mmdb,
fprintf(
stdout,
"Looked up %llu addresses in %.2f seconds. %.2f lookups per second.\n",
"Looked up %llu addresses in %.2f seconds. %.2Lf lookups per second.\n",
i,
seconds,
i / seconds);
(long double)i / seconds);
return true;
}
@@ -594,15 +607,15 @@ static MMDB_lookup_result_s lookup_or_die(MMDB_s *mmdb, const char *ipstr) {
MMDB_lookup_string(mmdb, ipstr, &gai_error, &mmdb_error);
if (0 != gai_error) {
#ifdef _WIN32
char const *const strerr = gai_strerrorA(gai_error);
#else
char const *const strerr = gai_strerror(gai_error);
#endif
fprintf(stderr,
"\n Error from call to getaddrinfo for %s - %s\n\n",
ipstr,
#ifdef _WIN32
gai_strerrorA(gai_error)
#else
gai_strerror(gai_error)
#endif
);
strerr);
exit(3);
}
@@ -643,7 +656,7 @@ static bool start_threaded_benchmark(MMDB_s *const mmdb,
int const thread_count,
int const iterations) {
struct thread_info *const tinfo =
calloc(thread_count, sizeof(struct thread_info));
calloc((size_t)thread_count, sizeof(struct thread_info));
if (!tinfo) {
fprintf(stderr, "calloc(): %s\n", strerror(errno));
return false;
@@ -685,7 +698,8 @@ static bool start_threaded_benchmark(MMDB_s *const mmdb,
}
long double const elapsed = end_time - start_time;
unsigned long long const total_ips = iterations * thread_count;
unsigned long long const total_ips =
(unsigned long long)(iterations * thread_count);
long double rate = total_ips;
if (elapsed != 0) {
rate = total_ips / elapsed;
@@ -717,7 +731,7 @@ static long double get_time(void) {
fprintf(stderr, "clock_gettime(): %s\n", strerror(errno));
return -1;
}
return tp.tv_sec + ((float)tp.tv_nsec / 1e9);
return (long double)tp.tv_sec + ((float)tp.tv_nsec / 1e9);
#else
time_t t = time(NULL);
if (t == (time_t)-1) {
+21
View File
@@ -0,0 +1,21 @@
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
endif()
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
execute_process(
COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}"
OUTPUT_VARIABLE rm_out
RESULT_VARIABLE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif()
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif()
endforeach()
+1 -1
View File
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT([libmaxminddb], [1.6.0], [support@maxmind.com])
AC_INIT([libmaxminddb], [1.12.2], [support@maxmind.com])
AC_CONFIG_SRCDIR([include/maxminddb.h])
AC_CONFIG_HEADERS([config.h include/maxminddb_config.h])
+38 -17
View File
@@ -2,13 +2,10 @@
use strict;
use warnings;
use autodie qw( :all );
use FindBin qw( $Bin );
use File::Path qw( mkpath );
use File::Slurp qw( edit_file read_file );
use File::Which qw( which );
sub main {
my $target = shift || "$Bin/..";
@@ -16,7 +13,7 @@ sub main {
my @translators = qw ( lowdown pandoc );
my $translator;
foreach my $p (@translators) {
if ( defined which($p) ) {
if ( _which($p) ) {
$translator = $p;
last;
}
@@ -33,6 +30,14 @@ sub main {
_make_man( $translator, $target, 'mmdblookup', 1 );
}
sub _which {
my $program = shift;
for my $path ( split /:/, $ENV{PATH} ) {
return 1 if -x "$path/$program";
}
return 0;
}
sub _make_man {
my $translator = shift;
my $target = shift;
@@ -54,7 +59,7 @@ sub _make_man {
'-M', "section:$section",
$input,
'-o', $output,
);
) == 0 or die "Failed to run pandoc: $?";
_pandoc_postprocess($output);
}
elsif ( $translator eq 'lowdown' ) {
@@ -67,18 +72,27 @@ sub _make_man {
'-M', "section:$section",
$input,
'-o', $output,
);
) == 0 or die "Failed to run lowdown: $?";
}
}
sub _make_lib_man_links {
my $target = shift;
my $header = read_file("$Bin/../include/maxminddb.h");
open my $header_fh, '<', "$Bin/../include/maxminddb.h"
or die "Failed to open header file: $!";
my $header = do { local $/; <$header_fh> };
die "Error reading file header file: $!" unless defined $header;
close $header_fh or die "Failed to close header file: $!";
for my $proto ( $header =~ /^ *extern.+?(MMDB_\w+)\(/gsm ) {
open my $fh, '>', "$target/man/man3/$proto.3";
print {$fh} ".so man3/libmaxminddb.3\n";
close $fh;
open my $fh, '>', "$target/man/man3/$proto.3"
or die "Failed to open file: $!";
print {$fh} ".so man3/libmaxminddb.3\n"
or die "Failed to write to file: $!";
close $fh or die "Failed to close file: $!";
}
}
@@ -87,13 +101,20 @@ sub _make_lib_man_links {
sub _pandoc_postprocess {
my $file = shift;
edit_file(
sub {
s/^\.IP\n\.nf/.IP "" 4\n.nf/gm;
s/(Automatically generated by Pandoc)(.+)$/$1/m;
},
$file
);
open my $fh, '<', $file or die "Failed to open man file for reading: $!";
my @lines = <$fh>;
die "Error when reading man page: $!" if $!;
close $fh or die "Failed to close file: $!";
for my $line (@lines) {
$line =~ s/^\.IP\n\.nf/.IP "" 4\n.nf/gm;
$line =~ s/(Automatically generated by Pandoc)(.+)$/$1/m;
}
open $fh, '>', $file or die "Failed to open file for writing: $!";
print $fh @lines or die "Failed to write to file: $!";
close $fh or die "Failed to close file: $!";
}
main(shift);
-54
View File
@@ -1,54 +0,0 @@
#!/usr/bin/env perl
use strict;
use warnings;
use FindBin qw( $Bin );
use Data::UUID;
use File::Slurp qw( read_file write_file );
use Path::Iterator::Rule;
sub main {
my $rule = Path::Iterator::Rule->new;
$rule->file->name(qr/_t.c$/);
my $ug = Data::UUID->new;
my $template = read_file("$Bin/../projects/test.vcxproj.template");
my @names;
for my $file ( $rule->all("$Bin/../t/") ) {
my ($name) = $file =~ /(\w*)_t.c$/;
next unless $name;
next if $name eq 'threads';
push @names, $name;
my $project = $template;
$project =~ s/%TESTNAME%/$name/g;
my $uuid = $ug->to_string( $ug->create );
$project =~ s/%UUID%/$uuid/g;
write_file( "$Bin/../projects/VS12-tests/$name.vcxproj", $project );
}
_modify_yml(@names);
}
sub _modify_yml {
my @names = @_;
my $exe_block = join "\n",
map { " - .\\projects\\VS12\\Debug\\test_${_}.exe" } @names;
my $file = "$Bin/../appveyor.yml";
my $config = read_file($file);
$config =~ s/(#EXES).*?(#ENDEXES)/$1\n$exe_block\n $2/s;
write_file( $file, $config );
}
main();
+1 -5
View File
@@ -115,8 +115,4 @@ popd
git push
message="$version
$notes"
hub release create -a "$dist" -m "$message" "$version"
gh release create --target "$(git branch --show-current)" -t "$version" -n "$notes" "$version" "$dist"
+12 -7
View File
@@ -93,11 +93,11 @@ typedef struct MMDB_entry_data_list_s {
# DESCRIPTION
The libmaxminddb library provides functions for working MaxMind DB files. See
http://maxmind.github.io/MaxMind-DB/ for the MaxMind DB format specification.
The database and results are all represented by different data structures.
Databases are opened by calling `MMDB_open()`. You can look up IP addresses as
a string with `MMDB_lookup_string()` or as a pointer to a `sockaddr`
structure with `MMDB_lookup_sockaddr()`.
https://maxmind.github.io/MaxMind-DB/ for the MaxMind DB format
specification. The database and results are all represented by different
data structures. Databases are opened by calling `MMDB_open()`. You can
look up IP addresses as a string with `MMDB_lookup_string()` or as a
pointer to a `sockaddr` structure with `MMDB_lookup_sockaddr()`.
If the lookup finds the IP address in the database, it returns a
`MMDB_lookup_result_s` structure. If that structure indicates that the database
@@ -851,6 +851,11 @@ int main(int argc, char **argv)
}
```
# REQUIREMENTS
libmaxminddb requires a minimum of POSIX.1-2001 support. If not specified
at compilation time, it defaults to requesting POSIX.1-2008 support.
# THREAD SAFETY
This library is thread safe when compiled and linked with a thread-safe
@@ -878,13 +883,13 @@ Rolsky (drolsky@maxmind.com).
# COPYRIGHT AND LICENSE
Copyright 2013-2014 MaxMind, Inc.
Copyright 2013-2025 MaxMind, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
+6 -4
View File
@@ -9,8 +9,10 @@ mmdblookup --file [FILE PATH] --ip [IP ADDRESS] [DATA PATH]
# DESCRIPTION
`mmdblookup` looks up an IP address in the specified MaxMind DB file. The
record for the IP address is displayed in a JSON-like structure with type
annotations.
record for the IP address is displayed with `{}` to denote maps and `[]` to
denote arrays. The values are followed by type annotations. This output is
_not_ JSON and is not intended to be used as such. If you need JSON, please
see [`mmdbinspect`](https://github.com/maxmind/mmdbinspect).
If an IP's data entry resolves to a map or array, you can provide a lookup
path to only show part of that data.
@@ -84,13 +86,13 @@ Rolsky (drolsky@maxmind.com).
# COPYRIGHT AND LICENSE
Copyright 2013-2014 MaxMind, Inc.
Copyright 2013-2025 MaxMind, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
-15
View File
@@ -5,18 +5,6 @@ extern "C" {
#ifndef MAXMINDDB_H
#define MAXMINDDB_H
/* Request POSIX.1-2008. However, we want to remain compatible with
* POSIX.1-2001 (since we have been historically and see no reason to drop
* compatibility). By requesting POSIX.1-2008, we can conditionally use
* features provided by that standard if the implementation provides it. We can
* check for what the implementation provides by checking the _POSIX_VERSION
* macro after including unistd.h. If a feature is in POSIX.1-2008 but not
* POSIX.1-2001, check that macro before using the feature (or check for the
* feature directly if possible). */
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L
#endif
#include "maxminddb_config.h"
#include <stdarg.h>
#include <stdbool.h>
@@ -28,9 +16,6 @@ extern "C" {
#include <winsock2.h>
#include <ws2tcpip.h>
/* libmaxminddb package version from configure */
#define PACKAGE_VERSION "1.6.0"
typedef ADDRESS_FAMILY sa_family_t;
#if defined(_MSC_VER)
/* MSVC doesn't define signed size_t, copy it from configure */
+1 -1
View File
@@ -2,7 +2,7 @@
#define MAXMINDDB_CONFIG_H
#ifndef MMDB_UINT128_USING_MODE
/* Define as 1 if we use unsigned int __atribute__ ((__mode__(TI))) for uint128 values */
/* Define as 1 if we use unsigned int __attribute__ ((__mode__(TI))) for uint128 values */
#cmakedefine MMDB_UINT128_USING_MODE @MMDB_UINT128_USING_MODE@
#endif
+1 -1
View File
@@ -2,7 +2,7 @@
#define MAXMINDDB_CONFIG_H
#ifndef MMDB_UINT128_USING_MODE
/* Define as 1 if we use unsigned int __atribute__ ((__mode__(TI))) for uint128 values */
/* Define as 1 if we use unsigned int __attribute__ ((__mode__(TI))) for uint128 values */
#define MMDB_UINT128_USING_MODE 0
#endif
@@ -1,105 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B19839F4-376C-11E7-A95B-48C58C130AD6}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>bad_pointers</RootNamespace>
<ProjectName>test_bad_pointers</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\t\libtap;$(SolutionDir)\..\..\src</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\t\bad_pointers_t.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="libtap.vcxproj">
<Project>{4dfc985a-83d7-4e61-85fe-c6ea6e43e3aa}</Project>
</ProjectReference>
<ProjectReference Include="..\VS12\libmaxminddb.vcxproj">
<Project>{82953bda-2960-4ada-a6d5-92e65ccb4a3d}</Project>
</ProjectReference>
<ProjectReference Include="maxminddb_test_helper.vcxproj">
<Project>{a8f568f6-5507-4ec2-a834-f2c0a3c635a5}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -1,105 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B1983C10-376C-11E7-A95B-48C58C130AD6}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>basic_lookup</RootNamespace>
<ProjectName>test_basic_lookup</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\t\libtap;$(SolutionDir)\..\..\src</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\t\basic_lookup_t.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="libtap.vcxproj">
<Project>{4dfc985a-83d7-4e61-85fe-c6ea6e43e3aa}</Project>
</ProjectReference>
<ProjectReference Include="..\VS12\libmaxminddb.vcxproj">
<Project>{82953bda-2960-4ada-a6d5-92e65ccb4a3d}</Project>
</ProjectReference>
<ProjectReference Include="maxminddb_test_helper.vcxproj">
<Project>{a8f568f6-5507-4ec2-a834-f2c0a3c635a5}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -1,105 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B1983E90-376C-11E7-A95B-48C58C130AD6}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>data_entry_list</RootNamespace>
<ProjectName>test_data_entry_list</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\t\libtap;$(SolutionDir)\..\..\src</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\t\data_entry_list_t.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="libtap.vcxproj">
<Project>{4dfc985a-83d7-4e61-85fe-c6ea6e43e3aa}</Project>
</ProjectReference>
<ProjectReference Include="..\VS12\libmaxminddb.vcxproj">
<Project>{82953bda-2960-4ada-a6d5-92e65ccb4a3d}</Project>
</ProjectReference>
<ProjectReference Include="maxminddb_test_helper.vcxproj">
<Project>{a8f568f6-5507-4ec2-a834-f2c0a3c635a5}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
-105
View File
@@ -1,105 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B198400C-376C-11E7-A95B-48C58C130AD6}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>data_types</RootNamespace>
<ProjectName>test_data_types</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\t\libtap;$(SolutionDir)\..\..\src</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\t\data_types_t.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="libtap.vcxproj">
<Project>{4dfc985a-83d7-4e61-85fe-c6ea6e43e3aa}</Project>
</ProjectReference>
<ProjectReference Include="..\VS12\libmaxminddb.vcxproj">
<Project>{82953bda-2960-4ada-a6d5-92e65ccb4a3d}</Project>
</ProjectReference>
<ProjectReference Include="maxminddb_test_helper.vcxproj">
<Project>{a8f568f6-5507-4ec2-a834-f2c0a3c635a5}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
-105
View File
@@ -1,105 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B1984188-376C-11E7-A95B-48C58C130AD6}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>dump</RootNamespace>
<ProjectName>test_dump</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\t\libtap;$(SolutionDir)\..\..\src</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\t\dump_t.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="libtap.vcxproj">
<Project>{4dfc985a-83d7-4e61-85fe-c6ea6e43e3aa}</Project>
</ProjectReference>
<ProjectReference Include="..\VS12\libmaxminddb.vcxproj">
<Project>{82953bda-2960-4ada-a6d5-92e65ccb4a3d}</Project>
</ProjectReference>
<ProjectReference Include="maxminddb_test_helper.vcxproj">
<Project>{a8f568f6-5507-4ec2-a834-f2c0a3c635a5}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
-105
View File
@@ -1,105 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B1984480-376C-11E7-A95B-48C58C130AD6}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>get_value</RootNamespace>
<ProjectName>test_get_value</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\t\libtap;$(SolutionDir)\..\..\src</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\t\get_value_t.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="libtap.vcxproj">
<Project>{4dfc985a-83d7-4e61-85fe-c6ea6e43e3aa}</Project>
</ProjectReference>
<ProjectReference Include="..\VS12\libmaxminddb.vcxproj">
<Project>{82953bda-2960-4ada-a6d5-92e65ccb4a3d}</Project>
</ProjectReference>
<ProjectReference Include="maxminddb_test_helper.vcxproj">
<Project>{a8f568f6-5507-4ec2-a834-f2c0a3c635a5}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -1,105 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B1984304-376C-11E7-A95B-48C58C130AD6}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>get_value_pointer_bug</RootNamespace>
<ProjectName>test_get_value_pointer_bug</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\t\libtap;$(SolutionDir)\..\..\src</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\t\get_value_pointer_bug_t.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="libtap.vcxproj">
<Project>{4dfc985a-83d7-4e61-85fe-c6ea6e43e3aa}</Project>
</ProjectReference>
<ProjectReference Include="..\VS12\libmaxminddb.vcxproj">
<Project>{82953bda-2960-4ada-a6d5-92e65ccb4a3d}</Project>
</ProjectReference>
<ProjectReference Include="maxminddb_test_helper.vcxproj">
<Project>{a8f568f6-5507-4ec2-a834-f2c0a3c635a5}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -1,105 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B198466A-376C-11E7-A95B-48C58C130AD6}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ipv4_start_cache</RootNamespace>
<ProjectName>test_ipv4_start_cache</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\t\libtap;$(SolutionDir)\..\..\src</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\t\ipv4_start_cache_t.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="libtap.vcxproj">
<Project>{4dfc985a-83d7-4e61-85fe-c6ea6e43e3aa}</Project>
</ProjectReference>
<ProjectReference Include="..\VS12\libmaxminddb.vcxproj">
<Project>{82953bda-2960-4ada-a6d5-92e65ccb4a3d}</Project>
</ProjectReference>
<ProjectReference Include="maxminddb_test_helper.vcxproj">
<Project>{a8f568f6-5507-4ec2-a834-f2c0a3c635a5}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -1,105 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B1984872-376C-11E7-A95B-48C58C130AD6}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ipv6_lookup_in_ipv4</RootNamespace>
<ProjectName>test_ipv6_lookup_in_ipv4</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\t\libtap;$(SolutionDir)\..\..\src</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\t\ipv6_lookup_in_ipv4_t.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="libtap.vcxproj">
<Project>{4dfc985a-83d7-4e61-85fe-c6ea6e43e3aa}</Project>
</ProjectReference>
<ProjectReference Include="..\VS12\libmaxminddb.vcxproj">
<Project>{82953bda-2960-4ada-a6d5-92e65ccb4a3d}</Project>
</ProjectReference>
<ProjectReference Include="maxminddb_test_helper.vcxproj">
<Project>{a8f568f6-5507-4ec2-a834-f2c0a3c635a5}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
-85
View File
@@ -1,85 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{4DFC985A-83D7-4E61-85FE-C6EA6E43E3AA}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>libtap</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/Z7 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\t\libtap\tap.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\t\libtap\tap.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -1,107 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{A8F568F6-5507-4EC2-A834-F2C0A3C635A5}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ConsoleApplication1</RootNamespace>
<ProjectName>test_maxminddb_test_helper</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\t\libtap;$(SolutionDir)\..\..\src</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\..\t\libtap\libtap.vcxproj">
<Project>{4dfc985a-83d7-4e61-85fe-c6ea6e43e3aa}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
<ProjectReference Include="..\VS12\libmaxminddb.vcxproj">
<Project>{82953bda-2960-4ada-a6d5-92e65ccb4a3d}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\t\maxminddb_test_helper.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\t\maxminddb_test_helper.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
-105
View File
@@ -1,105 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B1984C6E-376C-11E7-A95B-48C58C130AD6}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>metadata</RootNamespace>
<ProjectName>test_metadata</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\t\libtap;$(SolutionDir)\..\..\src</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\t\metadata_t.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="libtap.vcxproj">
<Project>{4dfc985a-83d7-4e61-85fe-c6ea6e43e3aa}</Project>
</ProjectReference>
<ProjectReference Include="..\VS12\libmaxminddb.vcxproj">
<Project>{82953bda-2960-4ada-a6d5-92e65ccb4a3d}</Project>
</ProjectReference>
<ProjectReference Include="maxminddb_test_helper.vcxproj">
<Project>{a8f568f6-5507-4ec2-a834-f2c0a3c635a5}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -1,105 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B19849D0-376C-11E7-A95B-48C58C130AD6}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>metadata_pointers</RootNamespace>
<ProjectName>test_metadata_pointers</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\t\libtap;$(SolutionDir)\..\..\src</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\t\metadata_pointers_t.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="libtap.vcxproj">
<Project>{4dfc985a-83d7-4e61-85fe-c6ea6e43e3aa}</Project>
</ProjectReference>
<ProjectReference Include="..\VS12\libmaxminddb.vcxproj">
<Project>{82953bda-2960-4ada-a6d5-92e65ccb4a3d}</Project>
</ProjectReference>
<ProjectReference Include="maxminddb_test_helper.vcxproj">
<Project>{a8f568f6-5507-4ec2-a834-f2c0a3c635a5}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -1,105 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B1984EC6-376C-11E7-A95B-48C58C130AD6}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>no_map_get_value</RootNamespace>
<ProjectName>test_no_map_get_value</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\t\libtap;$(SolutionDir)\..\..\src</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\t\no_map_get_value_t.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="libtap.vcxproj">
<Project>{4dfc985a-83d7-4e61-85fe-c6ea6e43e3aa}</Project>
</ProjectReference>
<ProjectReference Include="..\VS12\libmaxminddb.vcxproj">
<Project>{82953bda-2960-4ada-a6d5-92e65ccb4a3d}</Project>
</ProjectReference>
<ProjectReference Include="maxminddb_test_helper.vcxproj">
<Project>{a8f568f6-5507-4ec2-a834-f2c0a3c635a5}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
-105
View File
@@ -1,105 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B198504C-376C-11E7-A95B-48C58C130AD6}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>read_node</RootNamespace>
<ProjectName>test_read_node</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\t\libtap;$(SolutionDir)\..\..\src</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\t\read_node_t.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="libtap.vcxproj">
<Project>{4dfc985a-83d7-4e61-85fe-c6ea6e43e3aa}</Project>
</ProjectReference>
<ProjectReference Include="..\VS12\libmaxminddb.vcxproj">
<Project>{82953bda-2960-4ada-a6d5-92e65ccb4a3d}</Project>
</ProjectReference>
<ProjectReference Include="maxminddb_test_helper.vcxproj">
<Project>{a8f568f6-5507-4ec2-a834-f2c0a3c635a5}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
-104
View File
@@ -1,104 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{A8F568F6-5507-4EC2-A834-F2C0A3C635A5}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ConsoleApplication1</RootNamespace>
<ProjectName>test_maxminddb_test_helper</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\t\libtap;$(SolutionDir)\..\..\src</AdditionalIncludeDirectories>
<AdditionalOptions>/FS %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\VS12\libmaxminddb.vcxproj">
<Project>{82953bda-2960-4ada-a6d5-92e65ccb4a3d}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
<ProjectReference Include="libtap.vcxproj">
<Project>{4dfc985a-83d7-4e61-85fe-c6ea6e43e3aa}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\t\maxminddb_test_helper.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\t\maxminddb_test_helper.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
-103
View File
@@ -1,103 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{8E11E9FC-7B63-11E4-AE98-6B41E8A9DDB2}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>threads</RootNamespace>
<ProjectName>test_threads</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\t\libtap;$(SolutionDir)\..\..\src</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\t\threads_t.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="libtap.vcxproj">
<Project>{4dfc985a-83d7-4e61-85fe-c6ea6e43e3aa}</Project>
</ProjectReference>
<ProjectReference Include="..\VS12\libmaxminddb.vcxproj">
<Project>{82953bda-2960-4ada-a6d5-92e65ccb4a3d}</Project>
</ProjectReference>
<ProjectReference Include="maxminddb_test_helper.vcxproj">
<Project>{a8f568f6-5507-4ec2-a834-f2c0a3c635a5}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
-105
View File
@@ -1,105 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B19851FA-376C-11E7-A95B-48C58C130AD6}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>version</RootNamespace>
<ProjectName>test_version</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\t\libtap;$(SolutionDir)\..\..\src</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\t\version_t.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="libtap.vcxproj">
<Project>{4dfc985a-83d7-4e61-85fe-c6ea6e43e3aa}</Project>
</ProjectReference>
<ProjectReference Include="..\VS12\libmaxminddb.vcxproj">
<Project>{82953bda-2960-4ada-a6d5-92e65ccb4a3d}</Project>
</ProjectReference>
<ProjectReference Include="maxminddb_test_helper.vcxproj">
<Project>{a8f568f6-5507-4ec2-a834-f2c0a3c635a5}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
-64
View File
@@ -1,64 +0,0 @@
# Deprecated
*These files are deprecated and will be removed in a future release.
Please use CMake instead.*
# Project Notes
DO NOT modify project settings for each configuration and/or platform
on a per-project basis. Use property sheets to set shared configuration
properties. The rule of thumb - if you set same value for the same
property in more than one configuration or platform, you did it wrong.
## libmaxminddb.props
This is the base property sheet for libMaxMindDB project. It contains
settings that are shared between all configurations, such as compiler
warning level, not using link-time code generation, etc.
In order to minimize the number of property sheet files, this propery
sheet also contains settings for Win32 and Debug configurations, which
are overridden by the x64 and Release property sheets described below.
## libmaxminddb-release.props
This property sheet contains all Release settings and is shared between
Win32 and x64 release builds. It must be located higher than the base
property sheet in the property Manager window for each configuration
where it's used (i.e. Release|Win32 and Release|x64).
## libmaxminddb-x64.props
This property sheet contains all x64 settings and is shared between all
Debug and Release x64 configurations. It must be located higher than the
base property sheet in the property Manager window for each configuration
where it's used (i.e. Debug|x64 and Release|x64).
## Adding More Projects
If you want to add more projects into this solution, follow the same logic
and create their own property sheets. Do not use libmaxminddb property
sheets in those projects because it will interfere with their intermediate
directories. Instead, copy and rename libmaxminddb property sheets as a
starting point.
DO NOT add libmaxminddb.lib to the Additional Dependencies box of command
line tools or any other libraries you built, for that matter. This box is
only for standard Windows libraries. Instead, add libmaxminddb as a reference
to all command line tool projects. Do the same for any other library projects
you added to this solutionn.
For external 3rd-party .lib files, create a solution folder called Libraries
and add Debug, Debug64, Release, Release64 subfolders, then drag and drop all
versinos of .lib to their respective folders and use Exclude From Build in
each library file's property to assign them to the proper build confguration.
Unused libraries will be shown with a traffic stop sign in each configuration.
If you have a lot of projects, it might be easier to do this by editing .vcxproj
and .vcxproj.filters in a text editor.
# Tests
To use the tests, you must download the `libtap` and `maxmind-db` submodules.
This can be done by running `git submodule update --init --recursive` from
the Git checkout. Each test source file has a separate project. Once compiled,
the tests must be run from the base directory of the checkout.
@@ -1,32 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<OmitFramePointers>true</OmitFramePointers>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
-14
View File
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<IntDir>$(SolutionDir)$(Platform)\$(Configuration)\obj\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup>
<Lib>
<TargetMachine>MachineX64</TargetMachine>
</Lib>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
-32
View File
@@ -1,32 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<IntDir>$(SolutionDir)$(Configuration)\obj\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\..\include</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
<ExceptionHandling>false</ExceptionHandling>
<ProgramDataBaseFileName>$(OutDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
<Optimization>Disabled</Optimization>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<OmitFramePointers>false</OmitFramePointers>
<WholeProgramOptimization>false</WholeProgramOptimization>
</ClCompile>
<PreBuildEvent>
<Command>if NOT EXIST (..\..\include\maxminddb_config.h) (
copy maxminddb_config.h ..\..\include\maxminddb_config.h
)</Command>
</PreBuildEvent>
<Lib>
<TargetMachine>MachineX86</TargetMachine>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
-150
View File
@@ -1,150 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmaxminddb", "libmaxminddb.vcxproj", "{82953BDA-2960-4ADA-A6D5-92E65CCB4A3D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_basic_lookup", "..\VS12-tests\basic_lookup.vcxproj", "{8E11C512-7B63-11E4-AE98-6B41E8A9DDB2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_data_entry_list", "..\VS12-tests\data_entry_list.vcxproj", "{8E11C882-7B63-11E4-AE98-6B41E8A9DDB2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_data_types", "..\VS12-tests\data_types.vcxproj", "{8E11CBD4-7B63-11E4-AE98-6B41E8A9DDB2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_dump", "..\VS12-tests\dump.vcxproj", "{8E11CEEA-7B63-11E4-AE98-6B41E8A9DDB2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_get_value", "..\VS12-tests\get_value.vcxproj", "{8E11D5E8-7B63-11E4-AE98-6B41E8A9DDB2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_get_value_pointer_bug", "..\VS12-tests\get_value_pointer_bug.vcxproj", "{8E11D2AA-7B63-11E4-AE98-6B41E8A9DDB2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_ipv4_start_cache", "..\VS12-tests\ipv4_start_cache.vcxproj", "{8E11D930-7B63-11E4-AE98-6B41E8A9DDB2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_ipv6_lookup_in_ipv4", "..\VS12-tests\ipv6_lookup_in_ipv4.vcxproj", "{8E11DC64-7B63-11E4-AE98-6B41E8A9DDB2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtap", "..\VS12-tests\libtap.vcxproj", "{4DFC985A-83D7-4E61-85FE-C6EA6E43E3AA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_metadata", "..\VS12-tests\metadata.vcxproj", "{8E11DFC0-7B63-11E4-AE98-6B41E8A9DDB2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_no_map_get_value", "..\VS12-tests\no_map_get_value.vcxproj", "{8E11E33A-7B63-11E4-AE98-6B41E8A9DDB2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_read_node", "..\VS12-tests\read_node.vcxproj", "{8E11E68C-7B63-11E4-AE98-6B41E8A9DDB2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_maxminddb_test_helper", "..\VS12-tests\shared.vcxproj", "{A8F568F6-5507-4EC2-A834-F2C0A3C635A5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_version", "..\VS12-tests\version.vcxproj", "{8E11ED26-7B63-11E4-AE98-6B41E8A9DDB2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_bad_pointers", "..\VS12-tests\bad_pointers.vcxproj", "{8E11BAF4-7B63-11E4-AE98-6B41E8A9DDB2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_metadata_pointers", "..\VS12-tests\metadata_pointers.vcxproj", "{8E11CBD4-7B63-11E4-AE98-6B41E8A9DDB2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{82953BDA-2960-4ADA-A6D5-92E65CCB4A3D}.Debug|Win32.ActiveCfg = Debug|Win32
{82953BDA-2960-4ADA-A6D5-92E65CCB4A3D}.Debug|Win32.Build.0 = Debug|Win32
{82953BDA-2960-4ADA-A6D5-92E65CCB4A3D}.Debug|x64.ActiveCfg = Debug|x64
{82953BDA-2960-4ADA-A6D5-92E65CCB4A3D}.Debug|x64.Build.0 = Debug|x64
{82953BDA-2960-4ADA-A6D5-92E65CCB4A3D}.Release|Win32.ActiveCfg = Release|Win32
{82953BDA-2960-4ADA-A6D5-92E65CCB4A3D}.Release|Win32.Build.0 = Release|Win32
{82953BDA-2960-4ADA-A6D5-92E65CCB4A3D}.Release|x64.ActiveCfg = Release|x64
{82953BDA-2960-4ADA-A6D5-92E65CCB4A3D}.Release|x64.Build.0 = Release|x64
{8E11C512-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.ActiveCfg = Debug|Win32
{8E11C512-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.Build.0 = Debug|Win32
{8E11C512-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|x64.ActiveCfg = Debug|Win32
{8E11C512-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.ActiveCfg = Release|Win32
{8E11C512-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.Build.0 = Release|Win32
{8E11C512-7B63-11E4-AE98-6B41E8A9DDB2}.Release|x64.ActiveCfg = Release|Win32
{8E11C882-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.ActiveCfg = Debug|Win32
{8E11C882-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.Build.0 = Debug|Win32
{8E11C882-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|x64.ActiveCfg = Debug|Win32
{8E11C882-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.ActiveCfg = Release|Win32
{8E11C882-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.Build.0 = Release|Win32
{8E11C882-7B63-11E4-AE98-6B41E8A9DDB2}.Release|x64.ActiveCfg = Release|Win32
{8E11CBD4-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.ActiveCfg = Debug|Win32
{8E11CBD4-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.Build.0 = Debug|Win32
{8E11CBD4-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|x64.ActiveCfg = Debug|Win32
{8E11CBD4-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.ActiveCfg = Release|Win32
{8E11CBD4-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.Build.0 = Release|Win32
{8E11CBD4-7B63-11E4-AE98-6B41E8A9DDB2}.Release|x64.ActiveCfg = Release|Win32
{8E11CEEA-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.ActiveCfg = Debug|Win32
{8E11CEEA-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.Build.0 = Debug|Win32
{8E11CEEA-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|x64.ActiveCfg = Debug|Win32
{8E11CEEA-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.ActiveCfg = Release|Win32
{8E11CEEA-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.Build.0 = Release|Win32
{8E11CEEA-7B63-11E4-AE98-6B41E8A9DDB2}.Release|x64.ActiveCfg = Release|Win32
{8E11D5E8-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.ActiveCfg = Debug|Win32
{8E11D5E8-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.Build.0 = Debug|Win32
{8E11D5E8-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|x64.ActiveCfg = Debug|Win32
{8E11D5E8-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.ActiveCfg = Release|Win32
{8E11D5E8-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.Build.0 = Release|Win32
{8E11D5E8-7B63-11E4-AE98-6B41E8A9DDB2}.Release|x64.ActiveCfg = Release|Win32
{8E11D2AA-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.ActiveCfg = Debug|Win32
{8E11D2AA-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.Build.0 = Debug|Win32
{8E11D2AA-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|x64.ActiveCfg = Debug|Win32
{8E11D2AA-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.ActiveCfg = Release|Win32
{8E11D2AA-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.Build.0 = Release|Win32
{8E11D2AA-7B63-11E4-AE98-6B41E8A9DDB2}.Release|x64.ActiveCfg = Release|Win32
{8E11D930-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.ActiveCfg = Debug|Win32
{8E11D930-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.Build.0 = Debug|Win32
{8E11D930-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|x64.ActiveCfg = Debug|Win32
{8E11D930-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.ActiveCfg = Release|Win32
{8E11D930-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.Build.0 = Release|Win32
{8E11D930-7B63-11E4-AE98-6B41E8A9DDB2}.Release|x64.ActiveCfg = Release|Win32
{8E11DC64-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.ActiveCfg = Debug|Win32
{8E11DC64-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.Build.0 = Debug|Win32
{8E11DC64-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|x64.ActiveCfg = Debug|Win32
{8E11DC64-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.ActiveCfg = Release|Win32
{8E11DC64-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.Build.0 = Release|Win32
{8E11DC64-7B63-11E4-AE98-6B41E8A9DDB2}.Release|x64.ActiveCfg = Release|Win32
{4DFC985A-83D7-4E61-85FE-C6EA6E43E3AA}.Debug|Win32.ActiveCfg = Debug|Win32
{4DFC985A-83D7-4E61-85FE-C6EA6E43E3AA}.Debug|Win32.Build.0 = Debug|Win32
{4DFC985A-83D7-4E61-85FE-C6EA6E43E3AA}.Debug|x64.ActiveCfg = Debug|Win32
{4DFC985A-83D7-4E61-85FE-C6EA6E43E3AA}.Release|Win32.ActiveCfg = Release|Win32
{4DFC985A-83D7-4E61-85FE-C6EA6E43E3AA}.Release|Win32.Build.0 = Release|Win32
{4DFC985A-83D7-4E61-85FE-C6EA6E43E3AA}.Release|x64.ActiveCfg = Release|Win32
{8E11DFC0-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.ActiveCfg = Debug|Win32
{8E11DFC0-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.Build.0 = Debug|Win32
{8E11DFC0-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|x64.ActiveCfg = Debug|Win32
{8E11DFC0-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.ActiveCfg = Release|Win32
{8E11DFC0-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.Build.0 = Release|Win32
{8E11DFC0-7B63-11E4-AE98-6B41E8A9DDB2}.Release|x64.ActiveCfg = Release|Win32
{8E11E33A-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.ActiveCfg = Debug|Win32
{8E11E33A-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.Build.0 = Debug|Win32
{8E11E33A-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|x64.ActiveCfg = Debug|Win32
{8E11E33A-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.ActiveCfg = Release|Win32
{8E11E33A-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.Build.0 = Release|Win32
{8E11E33A-7B63-11E4-AE98-6B41E8A9DDB2}.Release|x64.ActiveCfg = Release|Win32
{8E11E68C-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.ActiveCfg = Debug|Win32
{8E11E68C-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.Build.0 = Debug|Win32
{8E11E68C-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|x64.ActiveCfg = Debug|Win32
{8E11E68C-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.ActiveCfg = Release|Win32
{8E11E68C-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.Build.0 = Release|Win32
{8E11E68C-7B63-11E4-AE98-6B41E8A9DDB2}.Release|x64.ActiveCfg = Release|Win32
{A8F568F6-5507-4EC2-A834-F2C0A3C635A5}.Debug|Win32.ActiveCfg = Debug|Win32
{A8F568F6-5507-4EC2-A834-F2C0A3C635A5}.Debug|Win32.Build.0 = Debug|Win32
{A8F568F6-5507-4EC2-A834-F2C0A3C635A5}.Debug|x64.ActiveCfg = Debug|Win32
{A8F568F6-5507-4EC2-A834-F2C0A3C635A5}.Release|Win32.ActiveCfg = Release|Win32
{A8F568F6-5507-4EC2-A834-F2C0A3C635A5}.Release|Win32.Build.0 = Release|Win32
{A8F568F6-5507-4EC2-A834-F2C0A3C635A5}.Release|x64.ActiveCfg = Release|Win32
{8E11ED26-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.ActiveCfg = Debug|Win32
{8E11ED26-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.Build.0 = Debug|Win32
{8E11ED26-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|x64.ActiveCfg = Debug|Win32
{8E11ED26-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.ActiveCfg = Release|Win32
{8E11ED26-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.Build.0 = Release|Win32
{8E11ED26-7B63-11E4-AE98-6B41E8A9DDB2}.Release|x64.ActiveCfg = Release|Win32
{8E11BAF4-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.ActiveCfg = Debug|Win32
{8E11BAF4-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|Win32.Build.0 = Debug|Win32
{8E11BAF4-7B63-11E4-AE98-6B41E8A9DDB2}.Debug|x64.ActiveCfg = Debug|Win32
{8E11BAF4-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.ActiveCfg = Release|Win32
{8E11BAF4-7B63-11E4-AE98-6B41E8A9DDB2}.Release|Win32.Build.0 = Release|Win32
{8E11BAF4-7B63-11E4-AE98-6B41E8A9DDB2}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
-143
View File
@@ -1,143 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\maxminddb.c" />
<ClCompile Include="..\..\src\data-pool.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\maxminddb.h" />
<ClInclude Include="..\..\src\data-pool.h" />
</ItemGroup>
<ItemGroup>
<None Include="README" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{82953BDA-2960-4ADA-A6D5-92E65CCB4A3D}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>libmaxminddb</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="libmaxminddb.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="libmaxminddb.props" />
<Import Project="libmaxminddb-x64.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="libmaxminddb.props" />
<Import Project="libmaxminddb-release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="libmaxminddb.props" />
<Import Project="libmaxminddb-x64.props" />
<Import Project="libmaxminddb-release.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<TargetName>$(ProjectName)d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<TargetName>$(ProjectName)d</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PreBuildEvent />
<Lib />
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PreBuildEvent />
<Lib />
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent />
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent />
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -1,32 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\maxminddb.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\data-pool.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\maxminddb.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-pool.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="README" />
</ItemGroup>
</Project>
-14
View File
@@ -1,14 +0,0 @@
#ifndef MAXMINDDB_CONFIG_H
#define MAXMINDDB_CONFIG_H
#ifndef MMDB_UINT128_USING_MODE
/* Define as 1 if we we use unsigned int __atribute__ ((__mode__(TI))) for uint128 values */
#define MMDB_UINT128_USING_MODE 0
#endif
#ifndef MMDB_UINT128_IS_BYTE_ARRAY
/* Define as 1 if we don't have an unsigned __int128 type */
#define MMDB_UINT128_IS_BYTE_ARRAY 1
#endif
#endif /* MAXMINDDB_CONFIG_H */
-105
View File
@@ -1,105 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{%UUID%}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>%TESTNAME%</RootNamespace>
<ProjectName>test_%TESTNAME%</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\t\libtap;$(SolutionDir)\..\..\src</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\t\%TESTNAME%_t.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="libtap.vcxproj">
<Project>{4dfc985a-83d7-4e61-85fe-c6ea6e43e3aa}</Project>
</ProjectReference>
<ProjectReference Include="..\VS12\libmaxminddb.vcxproj">
<Project>{82953bda-2960-4ada-a6d5-92e65ccb4a3d}</Project>
</ProjectReference>
<ProjectReference Include="maxminddb_test_helper.vcxproj">
<Project>{a8f568f6-5507-4ec2-a834-f2c0a3c635a5}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+4
View File
@@ -5,6 +5,10 @@ lib_LTLIBRARIES = libmaxminddb.la
libmaxminddb_la_SOURCES = maxminddb.c maxminddb-compat-util.h \
data-pool.c data-pool.h
libmaxminddb_la_LDFLAGS = -version-info 0:7:0 -export-symbols-regex '^MMDB_.*'
if WINDOWS
libmaxminddb_la_LDFLAGS += -no-undefined
endif
include_HEADERS = $(top_srcdir)/include/maxminddb.h
pkgconfig_DATA = libmaxminddb.pc
+11 -5
View File
@@ -1,3 +1,7 @@
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L
#endif
#include "data-pool.h"
#include "maxminddb.h"
@@ -5,8 +9,6 @@
#include <stddef.h>
#include <stdlib.h>
static bool can_multiply(size_t const, size_t const, size_t const);
// Allocate an MMDB_data_pool_s. It initially has space for size
// MMDB_entry_data_list_s structs.
MMDB_data_pool_s *data_pool_new(size_t const size) {
@@ -39,7 +41,7 @@ MMDB_data_pool_s *data_pool_new(size_t const size) {
// the given max. max will typically be SIZE_MAX.
//
// We want to know if we'll wrap around.
static bool can_multiply(size_t const max, size_t const m, size_t const n) {
bool can_multiply(size_t const max, size_t const m, size_t const n) {
if (m == 0) {
return false;
}
@@ -156,9 +158,13 @@ int main(void) {
}
static void test_can_multiply(void) {
{ ok(can_multiply(SIZE_MAX, 1, SIZE_MAX), "1*SIZE_MAX is ok"); }
{
ok(can_multiply(SIZE_MAX, 1, SIZE_MAX), "1*SIZE_MAX is ok");
}
{ ok(!can_multiply(SIZE_MAX, 2, SIZE_MAX), "2*SIZE_MAX is not ok"); }
{
ok(!can_multiply(SIZE_MAX, 2, SIZE_MAX), "2*SIZE_MAX is not ok");
}
{
ok(can_multiply(SIZE_MAX, 10240, sizeof(MMDB_entry_data_list_s)),
+1
View File
@@ -44,6 +44,7 @@ typedef struct MMDB_data_pool_s {
MMDB_entry_data_list_s *blocks[DATA_POOL_NUM_BLOCKS];
} MMDB_data_pool_s;
bool can_multiply(size_t const, size_t const, size_t const);
MMDB_data_pool_s *data_pool_new(size_t const);
void data_pool_destroy(MMDB_data_pool_s *const);
MMDB_entry_data_list_s *data_pool_alloc(MMDB_data_pool_s *const);
+1 -1
View File
@@ -5,7 +5,7 @@ includedir=@includedir@
Name: libmaxminddb
Description: C library for the MaxMind DB file format
URL: http://maxmind.github.io/libmaxminddb/
URL: https://maxmind.github.io/libmaxminddb/
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lmaxminddb
Cflags: -I${includedir}
+4 -4
View File
@@ -42,9 +42,9 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
static void *
static const void *
mmdb_memmem(const void *l, size_t l_len, const void *s, size_t s_len) {
register char *cur, *last;
const char *cur, *last;
const char *cl = (const char *)l;
const char *cs = (const char *)s;
@@ -61,9 +61,9 @@ mmdb_memmem(const void *l, size_t l_len, const void *s, size_t s_len) {
return memchr(l, (int)*cs, l_len);
/* the last position where its possible to find "s" in "l" */
last = (char *)cl + l_len - s_len;
last = cl + l_len - s_len;
for (cur = (char *)cl; cur <= last; cur++)
for (cur = cl; cur <= last; cur++)
if (cur[0] == cs[0] && memcmp(cur, cs, s_len) == 0)
return cur;
+169 -79
View File
@@ -1,13 +1,17 @@
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L
#endif
#if HAVE_CONFIG_H
#include <config.h>
#endif
#include "data-pool.h"
#include "maxminddb-compat-util.h"
#include "maxminddb.h"
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <limits.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
@@ -19,6 +23,10 @@
#endif
#include <windows.h>
#include <ws2ipdef.h>
#ifndef SSIZE_MAX
#define SSIZE_MAX INTPTR_MAX
#endif
typedef ADDRESS_FAMILY sa_family_t;
#else
#include <arpa/inet.h>
#include <sys/mman.h>
@@ -152,7 +160,7 @@ static int populate_description_metadata(MMDB_s *mmdb,
MMDB_entry_s *metadata_start);
static int resolve_any_address(const char *ipstr, struct addrinfo **addresses);
static int find_address_in_search_tree(const MMDB_s *const mmdb,
uint8_t *address,
uint8_t const *address,
sa_family_t address_family,
MMDB_lookup_result_s *result);
static record_info_s record_info_for_database(const MMDB_s *const mmdb);
@@ -162,7 +170,7 @@ static uint32_t get_left_28_bit_record(const uint8_t *record);
static uint32_t get_right_28_bit_record(const uint8_t *record);
static uint32_t data_section_offset_for_record(const MMDB_s *const mmdb,
uint64_t record);
static int path_length(va_list va_path);
static size_t path_length(va_list va_path);
static int lookup_path_in_array(const char *path_elem,
const MMDB_s *const mmdb,
MMDB_entry_data_s *entry_data);
@@ -201,7 +209,7 @@ dump_entry_data_list(FILE *stream,
int indent,
int *status);
static void print_indentation(FILE *stream, int i);
static char *bytes_to_hex(uint8_t *bytes, uint32_t size);
static char *bytes_to_hex(uint8_t const *bytes, uint32_t size);
#define CHECKED_DECODE_ONE(mmdb, offset, entry_data) \
do { \
@@ -284,18 +292,29 @@ int MMDB_open(const char *const filename, uint32_t flags, MMDB_s *const mmdb) {
goto cleanup;
}
uint32_t search_tree_size =
mmdb->metadata.node_count * mmdb->full_record_byte_size;
mmdb->data_section =
mmdb->file_content + search_tree_size + MMDB_DATA_SECTION_SEPARATOR;
if (search_tree_size + MMDB_DATA_SECTION_SEPARATOR >
(uint32_t)mmdb->file_size) {
if (!can_multiply(SSIZE_MAX,
mmdb->metadata.node_count,
mmdb->full_record_byte_size)) {
status = MMDB_INVALID_METADATA_ERROR;
goto cleanup;
}
mmdb->data_section_size = (uint32_t)mmdb->file_size - search_tree_size -
MMDB_DATA_SECTION_SEPARATOR;
ssize_t search_tree_size = (ssize_t)mmdb->metadata.node_count *
(ssize_t)mmdb->full_record_byte_size;
mmdb->data_section =
mmdb->file_content + search_tree_size + MMDB_DATA_SECTION_SEPARATOR;
if (mmdb->file_size < MMDB_DATA_SECTION_SEPARATOR ||
search_tree_size > mmdb->file_size - MMDB_DATA_SECTION_SEPARATOR) {
status = MMDB_INVALID_METADATA_ERROR;
goto cleanup;
}
ssize_t data_section_size =
mmdb->file_size - search_tree_size - MMDB_DATA_SECTION_SEPARATOR;
if (data_section_size > UINT32_MAX || data_section_size <= 0) {
status = MMDB_INVALID_METADATA_ERROR;
goto cleanup;
}
mmdb->data_section_size = (uint32_t)data_section_size;
// Although it is likely not possible to construct a database with valid
// valid metadata, as parsed above, and a data_section_size less than 3,
@@ -406,7 +425,6 @@ cleanup:;
#else // _WIN32
static int map_file(MMDB_s *const mmdb) {
ssize_t size;
int status = MMDB_SUCCESS;
int o_flags = O_RDONLY;
@@ -432,14 +450,14 @@ static int map_file(MMDB_s *const mmdb) {
goto cleanup;
}
size = s.st_size;
if (size < 0 || size != s.st_size) {
off_t size = s.st_size;
if (size < 0 || size > SSIZE_MAX) {
status = MMDB_OUT_OF_MEMORY_ERROR;
goto cleanup;
}
uint8_t *file_content =
(uint8_t *)mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
(uint8_t *)mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED, fd, 0);
if (MAP_FAILED == file_content) {
if (ENOMEM == errno) {
status = MMDB_OUT_OF_MEMORY_ERROR;
@@ -449,7 +467,7 @@ static int map_file(MMDB_s *const mmdb) {
goto cleanup;
}
mmdb->file_size = size;
mmdb->file_size = (ssize_t)size;
mmdb->file_content = file_content;
cleanup:;
@@ -471,12 +489,16 @@ static const uint8_t *find_metadata(const uint8_t *file_content,
ssize_t max_size = file_size > METADATA_BLOCK_MAX_SIZE
? METADATA_BLOCK_MAX_SIZE
: file_size;
if (max_size < 0) {
return NULL;
}
uint8_t *search_area = (uint8_t *)(file_content + (file_size - max_size));
uint8_t *start = search_area;
uint8_t *tmp;
uint8_t const *search_area = (file_content + (file_size - max_size));
uint8_t const *start = search_area;
uint8_t const *tmp;
do {
tmp = mmdb_memmem(search_area, max_size, METADATA_MARKER, marker_len);
tmp = mmdb_memmem(
search_area, (size_t)max_size, METADATA_MARKER, marker_len);
if (NULL != tmp) {
max_size -= tmp - search_area;
@@ -683,7 +705,7 @@ value_for_key_as_string(MMDB_entry_s *start, char *key, char const **value) {
type_num_to_name(entry_data.type));
return MMDB_INVALID_METADATA_ERROR;
}
*value = mmdb_strndup((char *)entry_data.utf8_string, entry_data.data_size);
*value = mmdb_strndup(entry_data.utf8_string, entry_data.data_size);
if (NULL == *value) {
return MMDB_OUT_OF_MEMORY_ERROR;
}
@@ -722,20 +744,22 @@ static int populate_languages_metadata(MMDB_s *mmdb,
mmdb->metadata.languages.count = 0;
mmdb->metadata.languages.names = calloc(array_size, sizeof(char *));
if (NULL == mmdb->metadata.languages.names) {
MMDB_free_entry_data_list(first_member);
return MMDB_OUT_OF_MEMORY_ERROR;
}
for (uint32_t i = 0; i < array_size; i++) {
member = member->next;
if (MMDB_DATA_TYPE_UTF8_STRING != member->entry_data.type) {
MMDB_free_entry_data_list(first_member);
return MMDB_INVALID_METADATA_ERROR;
}
mmdb->metadata.languages.names[i] =
mmdb_strndup((char *)member->entry_data.utf8_string,
member->entry_data.data_size);
mmdb->metadata.languages.names[i] = mmdb_strndup(
member->entry_data.utf8_string, member->entry_data.data_size);
if (NULL == mmdb->metadata.languages.names[i]) {
MMDB_free_entry_data_list(first_member);
return MMDB_OUT_OF_MEMORY_ERROR;
}
// We assign this as we go so that if we fail a calloc and need to
@@ -815,9 +839,8 @@ static int populate_description_metadata(MMDB_s *mmdb,
goto cleanup;
}
mmdb->metadata.description.descriptions[i]->language =
mmdb_strndup((char *)member->entry_data.utf8_string,
member->entry_data.data_size);
mmdb->metadata.description.descriptions[i]->language = mmdb_strndup(
member->entry_data.utf8_string, member->entry_data.data_size);
if (NULL == mmdb->metadata.description.descriptions[i]->language) {
status = MMDB_OUT_OF_MEMORY_ERROR;
@@ -831,9 +854,8 @@ static int populate_description_metadata(MMDB_s *mmdb,
goto cleanup;
}
mmdb->metadata.description.descriptions[i]->description =
mmdb_strndup((char *)member->entry_data.utf8_string,
member->entry_data.data_size);
mmdb->metadata.description.descriptions[i]->description = mmdb_strndup(
member->entry_data.utf8_string, member->entry_data.data_size);
if (NULL == mmdb->metadata.description.descriptions[i]->description) {
status = MMDB_OUT_OF_MEMORY_ERROR;
@@ -891,22 +913,24 @@ MMDB_lookup_result_s MMDB_lookup_sockaddr(const MMDB_s *const mmdb,
.netmask = 0,
.entry = {.mmdb = mmdb, .offset = 0}};
uint8_t mapped_address[16], *address;
uint8_t mapped_address[16];
uint8_t const *address;
if (mmdb->metadata.ip_version == 4) {
if (sockaddr->sa_family == AF_INET6) {
*mmdb_error = MMDB_IPV6_LOOKUP_IN_IPV4_DATABASE_ERROR;
return result;
}
address = (uint8_t *)&((struct sockaddr_in *)sockaddr)->sin_addr.s_addr;
address = (uint8_t const *)&((struct sockaddr_in const *)sockaddr)
->sin_addr.s_addr;
} else {
if (sockaddr->sa_family == AF_INET6) {
address = (uint8_t *)&((struct sockaddr_in6 *)sockaddr)
address = (uint8_t const *)&((struct sockaddr_in6 const *)sockaddr)
->sin6_addr.s6_addr;
} else {
address = mapped_address;
memset(address, 0, 12);
memcpy(address + 12,
&((struct sockaddr_in *)sockaddr)->sin_addr.s_addr,
memset(mapped_address, 0, 12);
memcpy(mapped_address + 12,
&((struct sockaddr_in const *)sockaddr)->sin_addr.s_addr,
4);
}
}
@@ -918,15 +942,15 @@ MMDB_lookup_result_s MMDB_lookup_sockaddr(const MMDB_s *const mmdb,
}
static int find_address_in_search_tree(const MMDB_s *const mmdb,
uint8_t *address,
uint8_t const *address,
sa_family_t address_family,
MMDB_lookup_result_s *result) {
record_info_s record_info = record_info_for_database(mmdb);
if (0 == record_info.right_record_offset) {
if (record_info.right_record_offset == 0) {
return MMDB_UNKNOWN_DATABASE_FORMAT_ERROR;
}
uint32_t value = 0;
uint64_t value = 0;
uint16_t current_bit = 0;
if (mmdb->metadata.ip_version == 6 && address_family == AF_INET) {
value = mmdb->ipv4_start_node.node_value;
@@ -940,6 +964,7 @@ static int find_address_in_search_tree(const MMDB_s *const mmdb,
uint8_t bit =
1U & (address[current_bit >> 3] >> (7 - (current_bit % 8)));
// Note that value*record_info.record_length can be larger than 2**32
record_pointer = &search_tree[value * record_info.record_length];
if (record_pointer + record_info.record_length > mmdb->data_section) {
return MMDB_CORRUPT_SEARCH_TREE_ERROR;
@@ -986,10 +1011,11 @@ static record_info_s record_info_for_database(const MMDB_s *const mmdb) {
record_info.left_record_getter = &get_uint32;
record_info.right_record_getter = &get_uint32;
record_info.right_record_offset = 4;
} else {
assert(false);
}
// Callers must check that right_record_offset is non-zero in case none of
// the above conditions matched.
return record_info;
}
@@ -1002,6 +1028,9 @@ static int find_ipv4_start_node(MMDB_s *const mmdb) {
}
record_info_s record_info = record_info_for_database(mmdb);
if (record_info.right_record_offset == 0) {
return MMDB_UNKNOWN_DATABASE_FORMAT_ERROR;
}
const uint8_t *search_tree = mmdb->file_content;
uint32_t node_value = 0;
@@ -1052,7 +1081,7 @@ static uint8_t record_type(const MMDB_s *const mmdb, uint64_t record) {
static uint32_t get_left_28_bit_record(const uint8_t *record) {
return record[0] * 65536 + record[1] * 256 + record[2] +
((record[3] & 0xf0) << 20);
(uint32_t)((record[3] & 0xf0) << 20);
}
static uint32_t get_right_28_bit_record(const uint8_t *record) {
@@ -1064,7 +1093,7 @@ int MMDB_read_node(const MMDB_s *const mmdb,
uint32_t node_number,
MMDB_search_node_s *const node) {
record_info_s record_info = record_info_for_database(mmdb);
if (0 == record_info.right_record_offset) {
if (record_info.right_record_offset == 0) {
return MMDB_UNKNOWN_DATABASE_FORMAT_ERROR;
}
@@ -1116,13 +1145,13 @@ int MMDB_get_value(MMDB_entry_s *const start,
int MMDB_vget_value(MMDB_entry_s *const start,
MMDB_entry_data_s *const entry_data,
va_list va_path) {
int length = path_length(va_path);
size_t length = path_length(va_path);
const char *path_elem;
int i = 0;
MAYBE_CHECK_SIZE_OVERFLOW(length,
SIZE_MAX / sizeof(const char *) - 1,
MMDB_INVALID_METADATA_ERROR);
if (length == SIZE_MAX) {
return MMDB_INVALID_METADATA_ERROR;
}
const char **path = calloc(length + 1, sizeof(const char *));
if (NULL == path) {
@@ -1137,18 +1166,17 @@ int MMDB_vget_value(MMDB_entry_s *const start,
int status = MMDB_aget_value(start, entry_data, path);
free((char **)path);
free(path);
return status;
}
static int path_length(va_list va_path) {
int i = 0;
const char *ignore;
static size_t path_length(va_list va_path) {
size_t i = 0;
va_list path_copy;
va_copy(path_copy, va_path);
while (NULL != (ignore = va_arg(path_copy, char *))) {
while (NULL != va_arg(path_copy, char *)) {
i++;
}
@@ -1221,7 +1249,7 @@ static int lookup_path_in_array(const char *path_elem,
int saved_errno = errno;
errno = 0;
int array_index = strtol(path_elem, &first_invalid, 10);
long array_index = strtol(path_elem, &first_invalid, 10);
if (ERANGE == errno) {
errno = saved_errno;
return MMDB_INVALID_LOOKUP_PATH_ERROR;
@@ -1236,11 +1264,11 @@ static int lookup_path_in_array(const char *path_elem,
}
}
if (*first_invalid || (uint32_t)array_index >= size) {
if (*first_invalid || (unsigned long)array_index >= size) {
return MMDB_LOOKUP_PATH_DOES_NOT_MATCH_DATA_ERROR;
}
for (int i = 0; i < array_index; i++) {
for (long i = 0; i < array_index; i++) {
/* We don't want to follow a pointer here. If the next element is a
* pointer we simply skip it and keep going */
CHECKED_DECODE_ONE(mmdb, entry_data->offset_to_next, entry_data);
@@ -1406,7 +1434,7 @@ static int decode_one(const MMDB_s *const mmdb,
DEBUG_MSGF("Extended type: %i (%s)", type, type_num_to_name(type));
}
entry_data->type = type;
entry_data->type = (uint32_t)type;
if (type == MMDB_DATA_TYPE_POINTER) {
uint8_t psize = ((ctrl >> 3) & 3) + 1;
@@ -1462,6 +1490,7 @@ static int decode_one(const MMDB_s *const mmdb,
}
size = 65821 + get_uint24(&mem[offset]);
offset += 3;
break;
default:
break;
}
@@ -1497,28 +1526,28 @@ static int decode_one(const MMDB_s *const mmdb,
DEBUG_MSGF("uint16 of size %d", size);
return MMDB_INVALID_DATA_ERROR;
}
entry_data->uint16 = (uint16_t)get_uintX(&mem[offset], size);
entry_data->uint16 = (uint16_t)get_uintX(&mem[offset], (int)size);
DEBUG_MSGF("uint16 value: %u", entry_data->uint16);
} else if (type == MMDB_DATA_TYPE_UINT32) {
if (size > 4) {
DEBUG_MSGF("uint32 of size %d", size);
return MMDB_INVALID_DATA_ERROR;
}
entry_data->uint32 = (uint32_t)get_uintX(&mem[offset], size);
entry_data->uint32 = (uint32_t)get_uintX(&mem[offset], (int)size);
DEBUG_MSGF("uint32 value: %u", entry_data->uint32);
} else if (type == MMDB_DATA_TYPE_INT32) {
if (size > 4) {
DEBUG_MSGF("int32 of size %d", size);
return MMDB_INVALID_DATA_ERROR;
}
entry_data->int32 = get_sintX(&mem[offset], size);
entry_data->int32 = get_sintX(&mem[offset], (int)size);
DEBUG_MSGF("int32 value: %i", entry_data->int32);
} else if (type == MMDB_DATA_TYPE_UINT64) {
if (size > 8) {
DEBUG_MSGF("uint64 of size %d", size);
return MMDB_INVALID_DATA_ERROR;
}
entry_data->uint64 = get_uintX(&mem[offset], size);
entry_data->uint64 = get_uintX(&mem[offset], (int)size);
DEBUG_MSGF("uint64 value: %" PRIu64, entry_data->uint64);
} else if (type == MMDB_DATA_TYPE_UINT128) {
if (size > 16) {
@@ -1531,7 +1560,7 @@ static int decode_one(const MMDB_s *const mmdb,
memcpy(entry_data->uint128 + 16 - size, &mem[offset], size);
}
#else
entry_data->uint128 = get_uint128(&mem[offset], size);
entry_data->uint128 = get_uint128(&mem[offset], (int)size);
#endif
} else if (type == MMDB_DATA_TYPE_FLOAT) {
if (size != 4) {
@@ -1550,7 +1579,7 @@ static int decode_one(const MMDB_s *const mmdb,
entry_data->double_value = get_ieee754_double(&mem[offset]);
DEBUG_MSGF("double value: %f", entry_data->double_value);
} else if (type == MMDB_DATA_TYPE_UTF8_STRING) {
entry_data->utf8_string = size == 0 ? "" : (char *)&mem[offset];
entry_data->utf8_string = size == 0 ? "" : (char const *)&mem[offset];
entry_data->data_size = size;
#ifdef MMDB_DEBUG
char *string =
@@ -1578,13 +1607,15 @@ get_ptr_from(uint8_t ctrl, uint8_t const *const ptr, int ptr_size) {
uint32_t new_offset;
switch (ptr_size) {
case 1:
new_offset = ((ctrl & 7) << 8) + ptr[0];
new_offset = (uint32_t)((ctrl & 7) << 8) + ptr[0];
break;
case 2:
new_offset = 2048 + ((ctrl & 7) << 16) + (ptr[0] << 8) + ptr[1];
new_offset = 2048 + (uint32_t)((ctrl & 7) << 16) +
(uint32_t)(ptr[0] << 8) + ptr[1];
break;
case 3:
new_offset = 2048 + 524288 + ((ctrl & 7) << 24) + get_uint24(ptr);
new_offset =
2048 + 524288 + (uint32_t)((ctrl & 7) << 24) + get_uint24(ptr);
break;
case 4:
default:
@@ -1605,6 +1636,8 @@ int MMDB_get_metadata_as_entry_data_list(
int MMDB_get_entry_data_list(MMDB_entry_s *start,
MMDB_entry_data_list_s **const entry_data_list) {
*entry_data_list = NULL;
MMDB_data_pool_s *const pool = data_pool_new(MMDB_POOL_INIT_SIZE);
if (!pool) {
return MMDB_OUT_OF_MEMORY_ERROR;
@@ -1618,6 +1651,10 @@ int MMDB_get_entry_data_list(MMDB_entry_s *start,
int const status =
get_entry_data_list(start->mmdb, start->offset, list, pool, 0);
if (MMDB_SUCCESS != status) {
data_pool_destroy(pool);
return status;
}
*entry_data_list = data_pool_to_list(pool);
if (!*entry_data_list) {
@@ -1732,7 +1769,7 @@ static int get_entry_data_list(const MMDB_s *const mmdb,
static float get_ieee754_float(const uint8_t *restrict p) {
volatile float f;
uint8_t *q = (void *)&f;
volatile uint8_t *q = (volatile void *)&f;
/* Windows builds don't use autoconf but we can assume they're all
* little-endian. */
#if MMDB_LITTLE_ENDIAN || _WIN32
@@ -1748,7 +1785,7 @@ static float get_ieee754_float(const uint8_t *restrict p) {
static double get_ieee754_double(const uint8_t *restrict p) {
volatile double d;
uint8_t *q = (void *)&d;
volatile uint8_t *q = (volatile void *)&d;
#if MMDB_LITTLE_ENDIAN || _WIN32
q[7] = p[0];
q[6] = p[1];
@@ -1803,7 +1840,16 @@ static void free_mmdb_struct(MMDB_s *const mmdb) {
}
if (NULL != mmdb->filename) {
#if defined(__clang__)
// This is a const char * that we need to free, which isn't valid. However it
// would mean changing the public API to fix this.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-qual"
#endif
FREE_AND_SET_NULL(mmdb->filename);
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
}
if (NULL != mmdb->file_content) {
#ifdef _WIN32
@@ -1812,12 +1858,30 @@ static void free_mmdb_struct(MMDB_s *const mmdb) {
* to cleanup then. */
WSACleanup();
#else
munmap((void *)mmdb->file_content, mmdb->file_size);
#if defined(__clang__)
// This is a const char * that we need to free, which isn't valid. However it
// would mean changing the public API to fix this.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-qual"
#endif
munmap((void *)mmdb->file_content, (size_t)mmdb->file_size);
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#endif
}
if (NULL != mmdb->metadata.database_type) {
#if defined(__clang__)
// This is a const char * that we need to free, which isn't valid. However it
// would mean changing the public API to fix this.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-qual"
#endif
FREE_AND_SET_NULL(mmdb->metadata.database_type);
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
}
free_languages_metadata(mmdb);
@@ -1830,7 +1894,16 @@ static void free_languages_metadata(MMDB_s *mmdb) {
}
for (size_t i = 0; i < mmdb->metadata.languages.count; i++) {
#if defined(__clang__)
// This is a const char * that we need to free, which isn't valid. However it
// would mean changing the public API to fix this.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-qual"
#endif
FREE_AND_SET_NULL(mmdb->metadata.languages.names[i]);
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
}
FREE_AND_SET_NULL(mmdb->metadata.languages.names);
}
@@ -1843,14 +1916,32 @@ static void free_descriptions_metadata(MMDB_s *mmdb) {
for (size_t i = 0; i < mmdb->metadata.description.count; i++) {
if (NULL != mmdb->metadata.description.descriptions[i]) {
if (NULL != mmdb->metadata.description.descriptions[i]->language) {
#if defined(__clang__)
// This is a const char * that we need to free, which isn't valid. However it
// would mean changing the public API to fix this.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-qual"
#endif
FREE_AND_SET_NULL(
mmdb->metadata.description.descriptions[i]->language);
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
}
if (NULL !=
mmdb->metadata.description.descriptions[i]->description) {
#if defined(__clang__)
// This is a const char * that we need to free, which isn't valid. However it
// would mean changing the public API to fix this.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-qual"
#endif
FREE_AND_SET_NULL(
mmdb->metadata.description.descriptions[i]->description);
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
}
FREE_AND_SET_NULL(mmdb->metadata.description.descriptions[i]);
}
@@ -1891,9 +1982,9 @@ dump_entry_data_list(FILE *stream,
*status = MMDB_INVALID_DATA_ERROR;
return NULL;
}
char *key = mmdb_strndup(
(char *)entry_data_list->entry_data.utf8_string,
entry_data_list->entry_data.data_size);
char *key =
mmdb_strndup(entry_data_list->entry_data.utf8_string,
entry_data_list->entry_data.data_size);
if (NULL == key) {
*status = MMDB_OUT_OF_MEMORY_ERROR;
return NULL;
@@ -1938,9 +2029,8 @@ dump_entry_data_list(FILE *stream,
fprintf(stream, "]\n");
} break;
case MMDB_DATA_TYPE_UTF8_STRING: {
char *string =
mmdb_strndup((char *)entry_data_list->entry_data.utf8_string,
entry_data_list->entry_data.data_size);
char *string = mmdb_strndup(entry_data_list->entry_data.utf8_string,
entry_data_list->entry_data.data_size);
if (NULL == string) {
*status = MMDB_OUT_OF_MEMORY_ERROR;
return NULL;
@@ -1952,7 +2042,7 @@ dump_entry_data_list(FILE *stream,
} break;
case MMDB_DATA_TYPE_BYTES: {
char *hex_string =
bytes_to_hex((uint8_t *)entry_data_list->entry_data.bytes,
bytes_to_hex(entry_data_list->entry_data.bytes,
entry_data_list->entry_data.data_size);
if (NULL == hex_string) {
@@ -2044,12 +2134,12 @@ dump_entry_data_list(FILE *stream,
static void print_indentation(FILE *stream, int i) {
char buffer[1024];
int size = i >= 1024 ? 1023 : i;
memset(buffer, 32, size);
memset(buffer, 32, (size_t)size);
buffer[size] = '\0';
fputs(buffer, stream);
}
static char *bytes_to_hex(uint8_t *bytes, uint32_t size) {
static char *bytes_to_hex(uint8_t const *bytes, uint32_t size) {
char *hex_string;
MAYBE_CHECK_SIZE_OVERFLOW(size, SIZE_MAX / 2 - 1, NULL);
+15 -1
View File
@@ -29,10 +29,18 @@ if(UNIX) # or if (NOT WIN32)
find_package(Threads)
endif()
if(WIN32)
# 4244, 4267 - libtap causes a significant number of conversion warning in
# our tests on Windows.
# 4996 - vsprintf used by libtap is unsafe.
add_definitions("/wd4244 /wd4267 /wd4996")
endif(WIN32)
foreach(TEST_TARGET_NAME ${TEST_TARGET_NAMES})
add_executable(${TEST_TARGET_NAME} ${TEST_TARGET_NAME}.c maxminddb_test_helper.c)
target_include_directories(${TEST_TARGET_NAME} PRIVATE ../src)
target_link_libraries(${TEST_TARGET_NAME} maxminddb tap)
target_compile_definitions(${TEST_TARGET_NAME} PRIVATE PACKAGE_VERSION="${PROJECT_VERSION}")
if(UNIX)
target_link_libraries(${TEST_TARGET_NAME} m)
@@ -42,5 +50,11 @@ foreach(TEST_TARGET_NAME ${TEST_TARGET_NAMES})
target_link_libraries(${TEST_TARGET_NAME} ${CMAKE_THREAD_LIBS_INIT})
endif()
add_test(${TEST_TARGET_NAME} ${TEST_TARGET_NAME})
add_test( NAME ${TEST_TARGET_NAME} COMMAND ${TEST_TARGET_NAME} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/t)
endforeach()
if(BUILD_FUZZING)
add_executable(fuzz_mmdb fuzz_mmdb.c)
target_include_directories(fuzz_mmdb PRIVATE ../src)
target_link_libraries(fuzz_mmdb maxminddb $ENV{LIB_FUZZING_ENGINE})
endif()
+6 -4
View File
@@ -2,9 +2,9 @@
void run_tests(int mode, const char *mode_desc) {
const char *filename = "MaxMind-DB-test-broken-pointers-24.mmdb";
const char *path = test_database_path(filename);
char *path = test_database_path(filename);
MMDB_s *mmdb = open_ok(path, mode, mode_desc);
free((void *)path);
free(path);
{
const char *ip = "1.1.1.16";
@@ -29,6 +29,9 @@ void run_tests(int mode, const char *mode_desc) {
"MMDB_get_entry_data_list returns MMDB_INVALID_DATA_ERROR for "
"bad pointer in data section");
// This is not necessary as on error we should not need to free
// anything. However test that it is safe to do so. See change in
// 1.12.2.
MMDB_free_entry_data_list(entry_data_list);
}
@@ -36,8 +39,7 @@ void run_tests(int mode, const char *mode_desc) {
const char *ip = "1.1.1.32";
int gai_error, mmdb_error;
MMDB_lookup_result_s UNUSED(result) =
MMDB_lookup_string(mmdb, ip, &gai_error, &mmdb_error);
MMDB_lookup_string(mmdb, ip, &gai_error, &mmdb_error);
cmp_ok(mmdb_error,
"==",
+5 -5
View File
@@ -36,7 +36,7 @@ void test_one_result(MMDB_s *mmdb,
} else {
// When looking up IPv4 addresses in a mixed DB the result will be
// something like "::1.2.3.4", not just "1.2.3.4".
int maxlen = strlen(expect) + 3;
size_t maxlen = strlen(expect) + 3;
real_expect = malloc(maxlen);
if (!real_expect) {
BAIL_OUT("could not allocate memory");
@@ -77,12 +77,12 @@ void run_ipX_tests(const char *filename,
int missing_ips_length,
const char *pairs[][2],
int pairs_rows) {
const char *path = test_database_path(filename);
char *path = test_database_path(filename);
int mode = Current_Mode;
const char *mode_desc = Current_Mode_Description;
MMDB_s *mmdb = open_ok(path, mode, mode_desc);
free((void *)path);
free(path);
char desc_suffix[500];
snprintf(desc_suffix, 500, "%s - %s", filename, mode_desc);
@@ -180,12 +180,12 @@ void all_record_sizes(int mode, const char *description) {
static void test_big_lookup(void) {
const char *const db_filename = "GeoIP2-Precision-Enterprise-Test.mmdb";
const char *const db_path = test_database_path(db_filename);
char *db_path = test_database_path(db_filename);
ok(db_path != NULL, "got database path");
MMDB_s *const mmdb = open_ok(db_path, MMDB_MODE_MMAP, "mmap mode");
ok(mmdb != NULL, "opened MMDB");
free((char *)db_path);
free(db_path);
int gai_err = 0, mmdb_err = 0;
const char *const ip_address = "81.2.69.160";
+15 -2
View File
@@ -28,7 +28,11 @@ int main(int argc, char *argv[])
{
const char *fname = "$test_db";
MMDB_s mmdb;
return MMDB_open(fname, MMDB_MODE_MMAP, &mmdb);
if (MMDB_open(fname, MMDB_MODE_MMAP, &mmdb) != MMDB_SUCCESS) {
return 1;
}
MMDB_close(&mmdb);
return 0;
}
EOF
@@ -45,8 +49,17 @@ my $include_dir = abs_path("$Bin/../include");
my $lib_dir = abs_path("$Bin/../src/.libs");
my $cxx = $ENV{CXX} || 'c++';
my @cxxflags = $ENV{CXXFLAGS} ? ( split ' ', $ENV{CXXFLAGS} ) : ();
_test_cmd(
[ $cxx, $file, "-I$include_dir", "-L$lib_dir", "-lmaxminddb", "-o$exe" ],
[
$cxx,
$file,
@cxxflags,
"-I$include_dir",
"-L$lib_dir",
"-lmaxminddb",
"-o$exe",
],
qr/^$/,
q{},
0,
+3 -1
View File
@@ -43,7 +43,9 @@ static void test_data_pool_new(void) {
}
static void test_data_pool_destroy(void) {
{ data_pool_destroy(NULL); }
{
data_pool_destroy(NULL);
}
{
MMDB_data_pool_s *const pool = data_pool_new(512);
+18 -19
View File
@@ -161,7 +161,7 @@ test_mapX_key_value_pair(MMDB_entry_data_list_s *entry_data_list) {
"==",
MMDB_DATA_TYPE_UTF8_STRING,
"found a map key in 'map{mapX}'");
const char *mapX_key_name = dup_entry_string_or_bail(mapX_key->entry_data);
char *mapX_key_name = dup_entry_string_or_bail(mapX_key->entry_data);
if (strcmp(mapX_key_name, "utf8_stringX") == 0) {
MMDB_entry_data_list_s *mapX_value = entry_data_list =
@@ -170,18 +170,18 @@ test_mapX_key_value_pair(MMDB_entry_data_list_s *entry_data_list) {
"==",
MMDB_DATA_TYPE_UTF8_STRING,
"'map{mapX}{utf8_stringX}' type is utf8_string");
const char *utf8_stringX_value =
char *utf8_stringX_value =
dup_entry_string_or_bail(mapX_value->entry_data);
ok(strcmp(utf8_stringX_value, "hello") == 0,
"map{mapX}{utf8_stringX} value is 'hello'");
free((void *)utf8_stringX_value);
free(utf8_stringX_value);
} else if (strcmp(mapX_key_name, "arrayX") == 0) {
entry_data_list = test_arrayX_value(entry_data_list);
} else {
ok(0, "unknown key found in map{mapX} - %s", mapX_key_name);
}
free((void *)mapX_key_name);
free(mapX_key_name);
return entry_data_list;
}
@@ -203,10 +203,9 @@ test_map_value(MMDB_entry_data_list_s *entry_data_list) {
"==",
MMDB_DATA_TYPE_UTF8_STRING,
"found a map key in 'map'");
const char *map_key_1_name =
dup_entry_string_or_bail(map_key_1->entry_data);
char *map_key_1_name = dup_entry_string_or_bail(map_key_1->entry_data);
ok(strcmp(map_key_1_name, "mapX") == 0, "key name is mapX");
free((void *)map_key_1_name);
free(map_key_1_name);
MMDB_entry_data_list_s *mapX = entry_data_list = entry_data_list->next;
cmp_ok(mapX->entry_data.type,
@@ -312,7 +311,7 @@ test_utf8_string_value(MMDB_entry_data_list_s *entry_data_list) {
"==",
MMDB_DATA_TYPE_UTF8_STRING,
"'utf8_string' key's value is a string");
const char *utf8_string = dup_entry_string_or_bail(value->entry_data);
char *utf8_string = dup_entry_string_or_bail(value->entry_data);
// This is hex for "unicode! ☯ - ♫" as bytes
char expect[19] = {0x75,
0x6e,
@@ -323,29 +322,29 @@ test_utf8_string_value(MMDB_entry_data_list_s *entry_data_list) {
0x65,
0x21,
0x20,
0xe2,
0x98,
0xaf,
(char)0xe2,
(char)0x98,
(char)0xaf,
0x20,
0x2d,
0x20,
0xe2,
0x99,
0xab,
(char)0xe2,
(char)0x99,
(char)0xab,
0x00};
is(utf8_string, expect, "got expected value for utf8_string key");
free((void *)utf8_string);
free(utf8_string);
return entry_data_list;
}
void run_tests(int mode, const char *description) {
const char *filename = "MaxMind-DB-test-decoder.mmdb";
const char *path = test_database_path(filename);
char *path = test_database_path(filename);
MMDB_s *mmdb = open_ok(path, mode, description);
free((void *)path);
free(path);
char *ip = "1.1.1.1";
MMDB_lookup_result_s result =
@@ -385,7 +384,7 @@ void run_tests(int mode, const char *description) {
MMDB_DATA_TYPE_UTF8_STRING,
"found a map key");
const char *key_name = dup_entry_string_or_bail(key->entry_data);
char *key_name = dup_entry_string_or_bail(key->entry_data);
if (strcmp(key_name, "array") == 0) {
entry_data_list = test_array_value(entry_data_list);
} else if (strcmp(key_name, "boolean") == 0) {
@@ -414,7 +413,7 @@ void run_tests(int mode, const char *description) {
ok(0, "unknown key found in map - %s", key_name);
}
free((void *)key_name);
free(key_name);
}
MMDB_free_entry_data_list(first);
+13 -13
View File
@@ -14,7 +14,7 @@ void test_all_data_types(MMDB_lookup_result_s *result,
description,
"utf8_string",
NULL);
const char *string = mmdb_strndup(data.utf8_string, data.data_size);
char *string = mmdb_strndup(data.utf8_string, data.data_size);
// This is hex for "unicode! ☯ - ♫" as bytes
char expect[19] = {0x75,
0x6e,
@@ -25,19 +25,19 @@ void test_all_data_types(MMDB_lookup_result_s *result,
0x65,
0x21,
0x20,
0xe2,
0x98,
0xaf,
(char)0xe2,
(char)0x98,
(char)0xaf,
0x20,
0x2d,
0x20,
0xe2,
0x99,
0xab,
(char)0xe2,
(char)0x99,
(char)0xab,
0x00};
is(string, expect, "got expected utf8_string value");
free((char *)string);
free(string);
}
{
@@ -67,7 +67,7 @@ void test_all_data_types(MMDB_lookup_result_s *result,
MMDB_entry_data_s data =
data_ok(result, MMDB_DATA_TYPE_BYTES, description, "bytes", NULL);
uint8_t expect[] = {0x00, 0x00, 0x00, 0x2a};
ok(memcmp((uint8_t *)data.bytes, expect, 4) == 0,
ok(memcmp(data.bytes, expect, 4) == 0,
"bytes field has expected value");
}
@@ -204,9 +204,9 @@ void test_all_data_types(MMDB_lookup_result_s *result,
"mapX",
"utf8_stringX",
NULL);
const char *string = mmdb_strndup(data.utf8_string, data.data_size);
char *string = mmdb_strndup(data.utf8_string, data.data_size);
is(string, "hello", "map{mapX}{utf8_stringX} is 'hello'");
free((char *)string);
free(string);
snprintf(
description, 500, "map{mapX}{arrayX} for %s - %s", ip, mode_desc);
@@ -417,7 +417,7 @@ void test_all_data_types_as_zero(MMDB_lookup_result_s *result,
void run_tests(int mode, const char *mode_desc) {
const char *filename = "MaxMind-DB-test-decoder.mmdb";
const char *path = test_database_path(filename);
char *path = test_database_path(filename);
MMDB_s *mmdb = open_ok(path, mode, mode_desc);
// All of the remaining tests require an open mmdb
@@ -426,7 +426,7 @@ void run_tests(int mode, const char *mode_desc) {
return;
}
free((void *)path);
free(path);
{
const char *ip = "not an ip";
+3 -2
View File
@@ -1,12 +1,13 @@
#define _XOPEN_SOURCE 700
#include "maxminddb_test_helper.h"
#ifdef HAVE_OPEN_MEMSTREAM
void run_tests(int mode, const char *mode_desc) {
const char *filename = "MaxMind-DB-test-decoder.mmdb";
const char *path = test_database_path(filename);
char *path = test_database_path(filename);
MMDB_s *mmdb = open_ok(path, mode, mode_desc);
free((void *)path);
free(path);
const char *ip = "1.1.1.1";
MMDB_lookup_result_s result =
+8
View File
@@ -5,12 +5,20 @@ use warnings;
use FindBin qw( $Bin );
_skip_tests_if_not_linux();
_skip_tests_if_required_modules_are_not_present();
_skip_tests_if_nm_is_not_present();
_test_libs_external_symbols();
done_testing();
sub _skip_tests_if_not_linux {
return if $^O eq 'linux';
print "1..0 # skip all tests skipped - this test requires Linux.\n";
exit 0;
}
sub _skip_tests_if_required_modules_are_not_present {
eval <<'EOF';
use Test::More 0.88;
+34
View File
@@ -0,0 +1,34 @@
#include "maxminddb-compat-util.h"
#include "maxminddb.h"
#include <unistd.h>
#define kMinInputLength 2
#define kMaxInputLength 4048
extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
int status;
FILE *fp;
MMDB_s mmdb;
char filename[256];
if (size < kMinInputLength || size > kMaxInputLength)
return 0;
sprintf(filename, "/tmp/libfuzzer.%d", getpid());
fp = fopen(filename, "wb");
if (!fp)
return 0;
fwrite(data, size, sizeof(uint8_t), fp);
fclose(fp);
status = MMDB_open(filename, MMDB_MODE_MMAP, &mmdb);
if (status == MMDB_SUCCESS)
MMDB_close(&mmdb);
unlink(filename);
return 0;
}
+2 -2
View File
@@ -47,9 +47,9 @@ void test_one_ip(MMDB_s *mmdb,
void run_tests(int mode, const char *mode_desc) {
const char *filename = "GeoIP2-City-Test.mmdb";
const char *path = test_database_path(filename);
char *path = test_database_path(filename);
MMDB_s *mmdb = open_ok(path, mode, mode_desc);
free((void *)path);
free(path);
/* This exercises a bug where the entire top-level value is a pointer to
* another part of the data section. */
+4 -4
View File
@@ -77,9 +77,9 @@ int call_vget_value(MMDB_entry_s *entry, MMDB_entry_data_s *entry_data, ...) {
void test_simple_structure(int mode, const char *mode_desc) {
const char *filename = "MaxMind-DB-test-decoder.mmdb";
const char *path = test_database_path(filename);
char *path = test_database_path(filename);
MMDB_s *mmdb = open_ok(path, mode, mode_desc);
free((void *)path);
free(path);
const char *ip = "1.1.1.1";
MMDB_lookup_result_s result =
@@ -242,9 +242,9 @@ void test_no_result(int status,
void test_nested_structure(int mode, const char *mode_desc) {
const char *filename = "MaxMind-DB-test-nested.mmdb";
const char *path = test_database_path(filename);
char *path = test_database_path(filename);
MMDB_s *mmdb = open_ok(path, mode, mode_desc);
free((void *)path);
free(path);
const char *ip = "1.1.1.1";
MMDB_lookup_result_s result =
+2 -2
View File
@@ -18,9 +18,9 @@ void test_one_ip(MMDB_s *mmdb,
void run_tests(int mode, const char *mode_desc) {
const char *filename = "MaxMind-DB-no-ipv4-search-tree.mmdb";
const char *path = test_database_path(filename);
char *path = test_database_path(filename);
MMDB_s *mmdb = open_ok(path, mode, mode_desc);
free((void *)path);
free(path);
test_one_ip(mmdb, "1.1.1.1", filename, mode_desc);
test_one_ip(mmdb, "255.255.255.255", filename, mode_desc);
+3 -4
View File
@@ -2,14 +2,13 @@
void run_tests(int mode, const char *mode_desc) {
const char *filename = "MaxMind-DB-test-ipv4-28.mmdb";
const char *path = test_database_path(filename);
char *path = test_database_path(filename);
MMDB_s *mmdb = open_ok(path, mode, mode_desc);
free((void *)path);
free(path);
const char *ip = "::abcd";
int gai_error, mmdb_error;
MMDB_lookup_result_s UNUSED(result) =
MMDB_lookup_string(mmdb, ip, &gai_error, &mmdb_error);
MMDB_lookup_string(mmdb, ip, &gai_error, &mmdb_error);
cmp_ok(mmdb_error,
"==",
+23 -11
View File
@@ -1,14 +1,14 @@
#include "maxminddb_test_helper.h"
#if HAVE_CONFIG_H
#include <config.h>
#endif
#define _POSIX_C_SOURCE 200112L
#include <assert.h>
#include <stdarg.h>
#include <sys/types.h>
#include "maxminddb.h"
#include "maxminddb_test_helper.h"
#ifdef _WIN32
#include <io.h>
@@ -26,7 +26,15 @@ void for_all_record_sizes(const char *filename_fmt,
int size = sizes[i];
char filename[500];
#if defined(__clang__)
// This warning seems ok to ignore here in the tests.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
#endif
snprintf(filename, 500, filename_fmt, size);
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
char description[14];
snprintf(description, 14, "%i bit record", size);
@@ -39,7 +47,7 @@ void for_all_modes(void (*tests)(int mode, const char *description)) {
tests(MMDB_MODE_MMAP, "mmap mode");
}
const char *test_database_path(const char *filename) {
char *test_database_path(const char *filename) {
char *test_db_dir;
#ifdef _WIN32
test_db_dir = "../t/maxmind-db/test-data";
@@ -59,12 +67,11 @@ const char *test_database_path(const char *filename) {
snprintf(path, 500, "%s/%s", test_db_dir, filename);
return (const char *)path;
return path;
}
const char *dup_entry_string_or_bail(MMDB_entry_data_s entry_data) {
const char *string =
mmdb_strndup(entry_data.utf8_string, entry_data.data_size);
char *dup_entry_string_or_bail(MMDB_entry_data_s entry_data) {
char *string = mmdb_strndup(entry_data.utf8_string, entry_data.data_size);
if (NULL == string) {
BAIL_OUT("mmdb_strndup failed");
}
@@ -73,7 +80,12 @@ const char *dup_entry_string_or_bail(MMDB_entry_data_s entry_data) {
}
MMDB_s *open_ok(const char *db_file, int mode, const char *mode_desc) {
if (0 != access(db_file, R_OK)) {
#ifdef _WIN32
int access_rv = _access(db_file, 04);
#else
int access_rv = access(db_file, R_OK);
#endif
if (access_rv != 0) {
BAIL_OUT("could not read the specified file - %s\nIf you are in a git "
"checkout try running 'git submodule update --init'",
db_file);
@@ -85,7 +97,7 @@ MMDB_s *open_ok(const char *db_file, int mode, const char *mode_desc) {
BAIL_OUT("could not allocate memory for our MMDB_s struct");
}
int status = MMDB_open(db_file, mode, mmdb);
int status = MMDB_open(db_file, (uint32_t)mode, mmdb);
int is_ok = ok(MMDB_SUCCESS == status,
"open %s status is success - %s",
@@ -211,9 +223,9 @@ MMDB_entry_data_s data_ok(MMDB_lookup_result_s *result,
"no error from call to MMDB_vget_value - %s",
description)) {
if (!cmp_ok(data.type,
if (!cmp_ok((int)data.type,
"==",
expect_type,
(int)expect_type,
"got the expected data type - %s",
description)) {
+8 -6
View File
@@ -1,6 +1,8 @@
/* Some test files may require something newer */
#if !defined(_GNU_SOURCE) && !defined(_POSIX_C_SOURCE)
#define _POSIX_C_SOURCE 200112L
// The spec says this should be set prior to including any headers, but since
// this is test code, it should be fine to set it here. Setting it here avoids
// setting it in every test program.
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L
#endif
#if HAVE_CONFIG_H
@@ -23,7 +25,7 @@
#include <netdb.h>
#endif
#if (_MSC_VER && _MSC_VER < 1900)
#if defined _MSC_VER && _MSC_VER < 1900
/* _snprintf has security issues, but I don't think it is worth
worrying about for the unit tests. */
#define snprintf _snprintf
@@ -45,8 +47,8 @@ extern void for_all_record_sizes(const char *filename_fmt,
const char *filename,
const char *description));
extern void for_all_modes(void (*tests)(int mode, const char *description));
extern const char *test_database_path(const char *filename);
extern const char *dup_entry_string_or_bail(MMDB_entry_data_s entry_data);
extern char *test_database_path(const char *filename);
extern char *dup_entry_string_or_bail(MMDB_entry_data_s entry_data);
extern MMDB_s *open_ok(const char *db_file, int mode, const char *mode_desc);
extern MMDB_lookup_result_s lookup_string_ok(MMDB_s *mmdb,
const char *ip,
+2 -2
View File
@@ -2,9 +2,9 @@
void run_tests(int mode, const char *mode_desc) {
const char *filename = "MaxMind-DB-test-metadata-pointers.mmdb";
const char *path = test_database_path(filename);
char *path = test_database_path(filename);
MMDB_s *mmdb = open_ok(path, mode, mode_desc);
free((void *)path);
free(path);
char *repeated_string = "Lots of pointers in metadata";
+17 -17
View File
@@ -3,8 +3,8 @@
void test_metadata(MMDB_s *mmdb, const char *mode_desc) {
cmp_ok(mmdb->metadata.node_count,
"==",
37,
"node_count is 37 - %s",
163,
"node_count is 163 - %s",
mode_desc);
cmp_ok(mmdb->metadata.record_size,
"==",
@@ -101,18 +101,18 @@ test_languages_value(MMDB_entry_data_list_s *entry_data_list) {
"==",
MMDB_DATA_TYPE_UTF8_STRING,
"first array entry is a UTF8_STRING");
const char *lang0 = dup_entry_string_or_bail(idx0->entry_data);
char *lang0 = dup_entry_string_or_bail(idx0->entry_data);
is(lang0, "en", "first language is en");
free((void *)lang0);
free(lang0);
MMDB_entry_data_list_s *idx1 = entry_data_list = entry_data_list->next;
cmp_ok(idx1->entry_data.type,
"==",
MMDB_DATA_TYPE_UTF8_STRING,
"second array entry is a UTF8_STRING");
const char *lang1 = dup_entry_string_or_bail(idx1->entry_data);
char *lang1 = dup_entry_string_or_bail(idx1->entry_data);
is(lang1, "zh", "second language is zh");
free((void *)lang1);
free(lang1);
return entry_data_list;
}
@@ -136,14 +136,14 @@ test_description_value(MMDB_entry_data_list_s *entry_data_list) {
"==",
MMDB_DATA_TYPE_UTF8_STRING,
"found a map key in 'map'");
const char *key_name = dup_entry_string_or_bail(key->entry_data);
char *key_name = dup_entry_string_or_bail(key->entry_data);
MMDB_entry_data_list_s *value = entry_data_list = entry_data_list->next;
cmp_ok(value->entry_data.type,
"==",
MMDB_DATA_TYPE_UTF8_STRING,
"map value is a UTF8_STRING");
const char *description = dup_entry_string_or_bail(value->entry_data);
char *description = dup_entry_string_or_bail(value->entry_data);
if (strcmp(key_name, "en") == 0) {
is(description,
@@ -157,8 +157,8 @@ test_description_value(MMDB_entry_data_list_s *entry_data_list) {
ok(0, "unknown key found in description map - %s", key_name);
}
free((void *)key_name);
free((void *)description);
free(key_name);
free(description);
}
return entry_data_list;
@@ -193,11 +193,11 @@ void test_metadata_as_data_entry_list(MMDB_s *mmdb, const char *mode_desc) {
MMDB_DATA_TYPE_UTF8_STRING,
"found a map key");
const char *key_name = dup_entry_string_or_bail(key->entry_data);
char *key_name = dup_entry_string_or_bail(key->entry_data);
if (strcmp(key_name, "node_count") == 0) {
MMDB_entry_data_list_s *value = entry_data_list =
entry_data_list->next;
cmp_ok(value->entry_data.uint32, "==", 37, "node_count == 37");
cmp_ok(value->entry_data.uint32, "==", 163, "node_count == 163");
} else if (strcmp(key_name, "record_size") == 0) {
MMDB_entry_data_list_s *value = entry_data_list =
entry_data_list->next;
@@ -228,9 +228,9 @@ void test_metadata_as_data_entry_list(MMDB_s *mmdb, const char *mode_desc) {
} else if (strcmp(key_name, "database_type") == 0) {
MMDB_entry_data_list_s *value = entry_data_list =
entry_data_list->next;
const char *type = dup_entry_string_or_bail(value->entry_data);
char *type = dup_entry_string_or_bail(value->entry_data);
is(type, "Test", "type == Test");
free((void *)type);
free(type);
} else if (strcmp(key_name, "languages") == 0) {
entry_data_list = test_languages_value(entry_data_list);
} else if (strcmp(key_name, "description") == 0) {
@@ -239,7 +239,7 @@ void test_metadata_as_data_entry_list(MMDB_s *mmdb, const char *mode_desc) {
ok(0, "unknown key found in metadata map - %s", key_name);
}
free((void *)key_name);
free(key_name);
}
MMDB_free_entry_data_list(first);
@@ -247,7 +247,7 @@ void test_metadata_as_data_entry_list(MMDB_s *mmdb, const char *mode_desc) {
void run_tests(int mode, const char *mode_desc) {
const char *file = "MaxMind-DB-test-ipv4-24.mmdb";
const char *path = test_database_path(file);
char *path = test_database_path(file);
MMDB_s *mmdb = open_ok(path, mode, mode_desc);
// All of the remaining tests require an open mmdb
@@ -255,7 +255,7 @@ void run_tests(int mode, const char *mode_desc) {
diag("could not open %s - skipping remaining tests", path);
return;
}
free((void *)path);
free(path);
test_metadata(mmdb, mode_desc);
test_metadata_as_data_entry_list(mmdb, mode_desc);
+2 -2
View File
@@ -2,9 +2,9 @@
void run_tests(int mode, const char *mode_desc) {
const char *filename = "MaxMind-DB-string-value-entries.mmdb";
const char *path = test_database_path(filename);
char *path = test_database_path(filename);
MMDB_s *mmdb = open_ok(path, mode, mode_desc);
free((void *)path);
free(path);
const char *ip = "1.1.1.1";
MMDB_lookup_result_s result =
+153 -138
View File
@@ -70,54 +70,59 @@ void run_read_node_tests(MMDB_s *mmdb,
void run_24_bit_record_tests(int mode, const char *mode_desc) {
const char *filename = "MaxMind-DB-test-mixed-24.mmdb";
const char *path = test_database_path(filename);
char *path = test_database_path(filename);
MMDB_s *mmdb = open_ok(path, mode, mode_desc);
free((void *)path);
free(path);
const uint32_t tests[7][5] = {
{0, 1, MMDB_RECORD_TYPE_SEARCH_NODE, 242, MMDB_RECORD_TYPE_EMPTY},
{
80,
81,
MMDB_RECORD_TYPE_SEARCH_NODE,
197,
MMDB_RECORD_TYPE_SEARCH_NODE,
},
{
96,
97,
MMDB_RECORD_TYPE_SEARCH_NODE,
242,
MMDB_RECORD_TYPE_EMPTY,
},
{
103,
242,
MMDB_RECORD_TYPE_EMPTY,
104,
MMDB_RECORD_TYPE_SEARCH_NODE,
},
{
127,
242,
MMDB_RECORD_TYPE_EMPTY,
315,
MMDB_RECORD_TYPE_DATA,
},
{
132,
329,
MMDB_RECORD_TYPE_DATA,
242,
MMDB_RECORD_TYPE_EMPTY,
},
{
241,
96,
MMDB_RECORD_TYPE_SEARCH_NODE,
242,
MMDB_RECORD_TYPE_EMPTY,
}};
const uint32_t tests[7][5] = {{
0,
1,
MMDB_RECORD_TYPE_SEARCH_NODE,
435,
MMDB_RECORD_TYPE_SEARCH_NODE,
},
{
80,
81,
MMDB_RECORD_TYPE_SEARCH_NODE,
323,
MMDB_RECORD_TYPE_SEARCH_NODE,
},
{
96,
97,
MMDB_RECORD_TYPE_SEARCH_NODE,
148,
MMDB_RECORD_TYPE_SEARCH_NODE,
},
{
103,
444,
MMDB_RECORD_TYPE_EMPTY,
104,
MMDB_RECORD_TYPE_SEARCH_NODE,
},
{
127,
444,
MMDB_RECORD_TYPE_EMPTY,
514,
MMDB_RECORD_TYPE_DATA,
},
{
132,
527,
MMDB_RECORD_TYPE_DATA,
444,
MMDB_RECORD_TYPE_EMPTY,
},
{
241,
444,
MMDB_RECORD_TYPE_EMPTY,
242,
MMDB_RECORD_TYPE_SEARCH_NODE,
}};
run_read_node_tests(mmdb, tests, 7, 24);
MMDB_close(mmdb);
@@ -126,54 +131,59 @@ void run_24_bit_record_tests(int mode, const char *mode_desc) {
void run_28_bit_record_tests(int mode, const char *mode_desc) {
const char *filename = "MaxMind-DB-test-mixed-28.mmdb";
const char *path = test_database_path(filename);
char *path = test_database_path(filename);
MMDB_s *mmdb = open_ok(path, mode, mode_desc);
free((void *)path);
free(path);
const uint32_t tests[7][5] = {
{0, 1, MMDB_RECORD_TYPE_SEARCH_NODE, 242, MMDB_RECORD_TYPE_EMPTY},
{
80,
81,
MMDB_RECORD_TYPE_SEARCH_NODE,
197,
MMDB_RECORD_TYPE_SEARCH_NODE,
},
{
96,
97,
MMDB_RECORD_TYPE_SEARCH_NODE,
242,
MMDB_RECORD_TYPE_EMPTY,
},
{
103,
242,
MMDB_RECORD_TYPE_EMPTY,
104,
MMDB_RECORD_TYPE_SEARCH_NODE,
},
{
127,
242,
MMDB_RECORD_TYPE_EMPTY,
315,
MMDB_RECORD_TYPE_DATA,
},
{
132,
329,
MMDB_RECORD_TYPE_DATA,
242,
MMDB_RECORD_TYPE_EMPTY,
},
{
241,
96,
MMDB_RECORD_TYPE_SEARCH_NODE,
242,
MMDB_RECORD_TYPE_EMPTY,
}};
const uint32_t tests[7][5] = {{
0,
1,
MMDB_RECORD_TYPE_SEARCH_NODE,
435,
MMDB_RECORD_TYPE_SEARCH_NODE,
},
{
80,
81,
MMDB_RECORD_TYPE_SEARCH_NODE,
323,
MMDB_RECORD_TYPE_SEARCH_NODE,
},
{
96,
97,
MMDB_RECORD_TYPE_SEARCH_NODE,
148,
MMDB_RECORD_TYPE_SEARCH_NODE,
},
{
103,
444,
MMDB_RECORD_TYPE_EMPTY,
104,
MMDB_RECORD_TYPE_SEARCH_NODE,
},
{
127,
444,
MMDB_RECORD_TYPE_EMPTY,
514,
MMDB_RECORD_TYPE_DATA,
},
{
132,
527,
MMDB_RECORD_TYPE_DATA,
444,
MMDB_RECORD_TYPE_EMPTY,
},
{
241,
444,
MMDB_RECORD_TYPE_EMPTY,
242,
MMDB_RECORD_TYPE_SEARCH_NODE,
}};
run_read_node_tests(mmdb, tests, 7, 28);
MMDB_close(mmdb);
@@ -182,54 +192,59 @@ void run_28_bit_record_tests(int mode, const char *mode_desc) {
void run_32_bit_record_tests(int mode, const char *mode_desc) {
const char *filename = "MaxMind-DB-test-mixed-32.mmdb";
const char *path = test_database_path(filename);
char *path = test_database_path(filename);
MMDB_s *mmdb = open_ok(path, mode, mode_desc);
free((void *)path);
free(path);
const uint32_t tests[7][5] = {
{0, 1, MMDB_RECORD_TYPE_SEARCH_NODE, 242, MMDB_RECORD_TYPE_EMPTY},
{
80,
81,
MMDB_RECORD_TYPE_SEARCH_NODE,
197,
MMDB_RECORD_TYPE_SEARCH_NODE,
},
{
96,
97,
MMDB_RECORD_TYPE_SEARCH_NODE,
242,
MMDB_RECORD_TYPE_EMPTY,
},
{
103,
242,
MMDB_RECORD_TYPE_EMPTY,
104,
MMDB_RECORD_TYPE_SEARCH_NODE,
},
{
127,
242,
MMDB_RECORD_TYPE_EMPTY,
315,
MMDB_RECORD_TYPE_DATA,
},
{
132,
329,
MMDB_RECORD_TYPE_DATA,
242,
MMDB_RECORD_TYPE_EMPTY,
},
{
241,
96,
MMDB_RECORD_TYPE_SEARCH_NODE,
242,
MMDB_RECORD_TYPE_EMPTY,
}};
const uint32_t tests[7][5] = {{
0,
1,
MMDB_RECORD_TYPE_SEARCH_NODE,
435,
MMDB_RECORD_TYPE_SEARCH_NODE,
},
{
80,
81,
MMDB_RECORD_TYPE_SEARCH_NODE,
323,
MMDB_RECORD_TYPE_SEARCH_NODE,
},
{
96,
97,
MMDB_RECORD_TYPE_SEARCH_NODE,
148,
MMDB_RECORD_TYPE_SEARCH_NODE,
},
{
103,
444,
MMDB_RECORD_TYPE_EMPTY,
104,
MMDB_RECORD_TYPE_SEARCH_NODE,
},
{
127,
444,
MMDB_RECORD_TYPE_EMPTY,
514,
MMDB_RECORD_TYPE_DATA,
},
{
132,
527,
MMDB_RECORD_TYPE_DATA,
444,
MMDB_RECORD_TYPE_EMPTY,
},
{
241,
444,
MMDB_RECORD_TYPE_EMPTY,
242,
MMDB_RECORD_TYPE_SEARCH_NODE,
}};
run_read_node_tests(mmdb, tests, 7, 32);
+9 -6
View File
@@ -128,10 +128,10 @@ void process_result(test_result_s *result,
void run_ipX_tests(MMDB_s *mmdb,
const char *pairs[][2],
int pairs_rows,
int mode,
const char *mode_desc) {
pthread_t threads[pairs_rows];
struct thread_arg thread_args[pairs_rows];
pthread_t *threads = malloc((unsigned long)pairs_rows * sizeof(pthread_t));
struct thread_arg *thread_args =
malloc((unsigned long)pairs_rows * sizeof(struct thread_arg));
for (int i = 0; i < pairs_rows; i += 1) {
thread_args[i].thread_id = i;
@@ -161,13 +161,16 @@ void run_ipX_tests(MMDB_s *mmdb,
free(test_result);
}
}
free(threads);
free(thread_args);
}
void run_tests(int mode, const char *mode_desc) {
const char *filename = "MaxMind-DB-test-mixed-32.mmdb";
const char *path = test_database_path(filename);
char *path = test_database_path(filename);
MMDB_s *mmdb = open_ok(path, mode, mode_desc);
free((void *)path);
free(path);
const char *pairs[18][2] = {
{"1.1.1.1", "::1.1.1.1"},
@@ -190,7 +193,7 @@ void run_tests(int mode, const char *mode_desc) {
{"::2:0:59", "::2:0:58"},
};
run_ipX_tests(mmdb, pairs, 18, mode, mode_desc);
run_ipX_tests(mmdb, pairs, 18, mode_desc);
MMDB_close(mmdb);
free(mmdb);