diff --git a/.github/workflows/dist_publish.yml b/.github/workflows/dist_publish.yml index ce86618..d1396c6 100644 --- a/.github/workflows/dist_publish.yml +++ b/.github/workflows/dist_publish.yml @@ -11,6 +11,9 @@ on: jobs: build_llvm_win: name: Build LLVM release for Windows + strategy: + matrix: + arch: [x64, x86] runs-on: windows-latest steps: - name: Cache LLVM @@ -20,7 +23,7 @@ jobs: path: llvm/install # TODO: would be really better to add the hash of the LLVM commit cloned # TODO: add "14.16" as a variable easy to replace - key: ${{ runner.os }}-llvm-release-11-msvc1416 + key: ${{ runner.os }}-llvm-release-11-msvc1416-${{ matrix.arch }} - name: Get LLVM if: steps.cache-llvm.outputs.cache-hit != 'true' uses: actions/checkout@v2 @@ -32,6 +35,7 @@ jobs: if: steps.cache-llvm.outputs.cache-hit != 'true' with: toolset: "14.16" + arch: ${{ matrix.arch }} - name: Build LLVM if: steps.cache-llvm.outputs.cache-hit != 'true' run: | @@ -143,9 +147,12 @@ jobs: os: - macos-latest - windows-latest + arch: [x64, x86] exclude: - os: windows-latest python-version: 2.7 + - os: macos-latest + arch: x86 runs-on: ${{ matrix.os }} needs: build_llvm_win @@ -155,18 +162,20 @@ jobs: - uses: ilammy/msvc-dev-cmd@v1 with: toolset: "14.16" + arch: ${{ matrix.arch }} if: runner.os == 'Windows' - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.arch }} - name: Cache LLVM if: runner.os == 'Windows' id: cache-llvm uses: actions/cache@v2 with: path: llvm/install - key: ${{ runner.os }}-llvm-release-11-msvc1416 + key: ${{ runner.os }}-llvm-release-11-msvc1416-${{ matrix.arch }} - name: Python dependencies run: | pip install wheel diff --git a/include/dffi/compat.h b/include/dffi/compat.h index a07d5e2..66f155b 100644 --- a/include/dffi/compat.h +++ b/include/dffi/compat.h @@ -40,8 +40,15 @@ #endif #if defined(_MSC_VER) -#include -typedef SSIZE_T ssize_t; +// LLVM's C API defines "by hand" ssize_t. We need to do the same otherwise we +// got a conflicting type... +// #include +// typedef SSIZE_T ssize_t; +#if defined(_WIN64) +typedef signed __int64 ssize_t; +#else +typedef signed int ssize_t; +#endif /* _WIN64 */ #endif