Skip to content

#if defined(_MSC_VER) is not sufficient to detect "building for Windows" #187

Description

@linusg

This breaks when using the Zig toolchain to (cross-)compile for Windows, for instance.

/home/linus/.cache/zig/p/1220548d4c0c4895ae0b0d3e8e4c66bae071d069f8405f8e3812b6c122e3fe0c7fe4/cutils.c:660:7: error: call to undeclared function 'clock_gettime'; ISO C99 and later do not support implicit function declarations
  if (clock_gettime(CLOCK_MONOTONIC, &t))
      ^
/home/linus/.cache/zig/p/1220548d4c0c4895ae0b0d3e8e4c66bae071d069f8405f8e3812b6c122e3fe0c7fe4/cutils.c:660:21: error: use of undeclared identifier 'CLOCK_MONOTONIC'
  if (clock_gettime(CLOCK_MONOTONIC, &t))
                    ^

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions