Skip to content

Build issue on windows #121

@axelhj

Description

@axelhj

I just cloned the repository and executed make in the directory but it failed:

ttyclock.c: In function 'key_event':
ttyclock.c:443:16: error: implicit declaration of function 'nanosleep' [-Wimplicit-function-declaration]
  443 |                nanosleep(&length, NULL);

I think that nanosleep is specific to Linux but not included in Posix. It would be neat if the timer was configurable to use sleep which is part of the C standard. This would potentially reduce precision/make the library unable to display milliseconds, but the use of sleep could be configurable at compile time e.g with conditionally included sourcefiles to switch sleep implementation.

I might consider implementing this if none are opposed to the feature (MSYS2-compatibility).

Reference: nanosleep

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions