Skip to content

define _DEFAULT_SOURCE on non-windows environments to prevent feature test macros from removing functions like clock_gettime() #152

@irremnent

Description

@irremnent

When using a C compiler like gcc or clang, specifying a standard such as -std=c11 will define special macros that will cause the compiler to strip out certain definitions from header files--namely time.h. This will cause nob to fail to compile due to implicit declaration of functions like clock_gettime(), nanosleep(), and lstat(). To prevent this, _DEFAULT_SOURCE can be defined before including any header files.

I am unsure if this is an issue on windows systems.

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