I'm curious if others have thoughts on how to best handle feature macros. Should we make the equivalent change in the Makefile and add -D_POSIX_C_SOURCE=200809L? We can instead set it in a commonly used header like platform.h. Or we can define it as needed on a file-by-file basis, but that might be ugly.

Also, if we add it to a header we can take the logic currently in dmi.c and do this:
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 10) || __GLIBC__ < 2
#define _GNU_SOURCE
#else
#define _POSIX_C_SOURCE 200809L
#endif

Thoughts?

View Change

To view, visit change 43599. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Idb80937bb78e173eb03f2a0c0cdd8925fcd7bfa1
Gerrit-Change-Number: 43599
Gerrit-PatchSet: 1
Gerrit-Owner: David Hendricks <david.hendricks@gmail.com>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-Comment-Date: Mon, 20 Jul 2020 00:04:18 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment