Skip to content

Guard #define __STDC_NO_ATOMICS__ by #ifndef #656

@Bodigrim

Description

@Bodigrim

The following error was reported at https://www.reddit.com/r/haskell/comments/1nrt23b/comment/ngka3xp/:

error: <command-line>: warning: "__STDC_NO_ATOMICS__" redefined 

I'm not really sure under which circumstances it could happen (the Reddit thread is about using GHC on a Solaris-family OS), but we can certainly guard #define __STDC_NO_ATOMICS__ by #ifndef __STDC_NO_ATOMICS__ in

text/cbits/measure_off.c

Lines 17 to 23 in 86b5590

#if !(__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 9 || defined(__clang_major__))
#define __STDC_NO_ATOMICS__
#endif
#ifndef __STDC_NO_ATOMICS__
#include <stdatomic.h>
#endif

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