Skip to content

Commit

Permalink
Fix Windows extension build
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwald committed Nov 3, 2023
1 parent 7c3a93b commit f7b3bed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ jobs:

strategy:
matrix:
# We don't test on Windows currently due to issues
# build libmaxminddb there.
platform: [macos-latest, ubuntu-latest]
platform: [macos-latest, ubuntu-latest, windows-latest]
python-version: [3.8, 3.9, "3.10", 3.11, 3.12]

name: Python ${{ matrix.python-version }} on ${{ matrix.platform }}
Expand Down
9 changes: 7 additions & 2 deletions extension/maxminddb.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#ifdef MS_WINDOWS
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <arpa/inet.h>
#include <maxminddb.h>
#include <netinet/in.h>
#include <structmember.h>
#include <sys/socket.h>
#include <unistd.h>
#endif
#include <maxminddb.h>
#include <structmember.h>

#define __STDC_FORMAT_MACROS
#include <inttypes.h>
Expand Down

0 comments on commit f7b3bed

Please sign in to comment.