You've already forked cpp-httplib
* Fix #2148 * Removed 32bit environment * buld-error-check-on-32bit * Use 32bit depedency from Windows
This commit is contained in:
28
.github/workflows/test.yaml
vendored
28
.github/workflows/test.yaml
vendored
@ -40,7 +40,7 @@ jobs:
|
|||||||
clang-format --version
|
clang-format --version
|
||||||
cd test && make style_check
|
cd test && make style_check
|
||||||
|
|
||||||
ubuntu:
|
build-error-check-on-32bit:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: >
|
if: >
|
||||||
(github.event_name == 'push') ||
|
(github.event_name == 'push') ||
|
||||||
@ -53,10 +53,28 @@ jobs:
|
|||||||
- arch_flags: -m32
|
- arch_flags: -m32
|
||||||
arch_suffix: :i386
|
arch_suffix: :i386
|
||||||
name: (32-bit)
|
name: (32-bit)
|
||||||
- arch_flags:
|
steps:
|
||||||
arch_suffix:
|
- name: checkout
|
||||||
name: (64-bit)
|
uses: actions/checkout@v4
|
||||||
name: ubuntu ${{ matrix.config.name }}
|
- name: install libraries
|
||||||
|
run: |
|
||||||
|
sudo dpkg --add-architecture i386
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y libc6-dev${{ matrix.config.arch_suffix }} libstdc++-13-dev${{ matrix.config.arch_suffix }} \
|
||||||
|
libssl-dev${{ matrix.config.arch_suffix }} libcurl4-openssl-dev${{ matrix.config.arch_suffix }} \
|
||||||
|
zlib1g-dev${{ matrix.config.arch_suffix }} libbrotli-dev${{ matrix.config.arch_suffix }} \
|
||||||
|
libzstd-dev${{ matrix.config.arch_suffix }}
|
||||||
|
- name: build and run tests (expect failure)
|
||||||
|
run: cd test && make test EXTRA_CXXFLAGS="${{ matrix.config.arch_flags }}"
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
ubuntu:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: >
|
||||||
|
(github.event_name == 'push') ||
|
||||||
|
(github.event_name == 'pull_request' &&
|
||||||
|
github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) ||
|
||||||
|
(github.event_name == 'workflow_dispatch' && github.event.inputs.test_linux == 'true')
|
||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
19
httplib.h
19
httplib.h
@ -10,6 +10,21 @@
|
|||||||
|
|
||||||
#define CPPHTTPLIB_VERSION "0.22.0"
|
#define CPPHTTPLIB_VERSION "0.22.0"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Platform compatibility check
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(_WIN32) && !defined(_WIN64)
|
||||||
|
#error \
|
||||||
|
"cpp-httplib doesn't support 32-bit Windows. Please use a 64-bit compiler."
|
||||||
|
#elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ < 8
|
||||||
|
#error \
|
||||||
|
"cpp-httplib doesn't support 32-bit platforms. Please use a 64-bit compiler."
|
||||||
|
#elif defined(__SIZEOF_SIZE_T__) && __SIZEOF_SIZE_T__ < 8
|
||||||
|
#error \
|
||||||
|
"cpp-httplib doesn't support platforms where size_t is less than 64 bits."
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Configuration
|
* Configuration
|
||||||
*/
|
*/
|
||||||
@ -177,11 +192,7 @@
|
|||||||
|
|
||||||
#pragma comment(lib, "ws2_32.lib")
|
#pragma comment(lib, "ws2_32.lib")
|
||||||
|
|
||||||
#ifdef _WIN64
|
|
||||||
using ssize_t = __int64;
|
using ssize_t = __int64;
|
||||||
#else
|
|
||||||
using ssize_t = long;
|
|
||||||
#endif
|
|
||||||
#endif // _MSC_VER
|
#endif // _MSC_VER
|
||||||
|
|
||||||
#ifndef S_ISREG
|
#ifndef S_ISREG
|
||||||
|
Reference in New Issue
Block a user