Skip to content

Commit

Permalink
More CI workflow work.
Browse files Browse the repository at this point in the history
Also change msvc_random hack to detect MSVC itself, as it turned out
that the Windows CI environment was actually running MinGW.
  • Loading branch information
kristomu committed Jul 31, 2024
1 parent b4c7608 commit 6de9988
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
matrix:
os: [ubuntu-22.04, windows-latest]
build_type: [Release]
# TODO? mingw32 on Windows?
cpp_compiler: [g++, clang++, cl]
include:
- os: ubuntu-22.04
Expand Down Expand Up @@ -76,6 +77,9 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
submodules: true

- if: matrix.os == 'windows-latest'
uses: ilammy/[email protected]

- name: "Create directory '${{ env.VCPKG_DEFAULT_BINARY_CACHE }}'"
run: mkdir -p $VCPKG_DEFAULT_BINARY_CACHE
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion src/hack/msvc_random.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// need in a way that MSVC understands.

// MSVC RANDOM HACK
#if _WIN32
#if defined(_MSC_VER)
#define srand48(x) (srand((unsigned int(x))))
#define drand48() ((double)rand()/(RAND_MAX+1.0))
#define srandom(x) (srand((unsigned int)(x)))
Expand Down

0 comments on commit 6de9988

Please sign in to comment.