Attention is currently required from: Alexander Goncharov, Anastasia Klimchuk, Anton Samsonov, Thomas Heijligen.
Anton Samsonov has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/77089?usp=email )
Change subject: Remove dependency on C23 __has_include() ......................................................................
Patch Set 3:
(4 comments)
Patchset:
PS1:
Appreciate your explanation. I don't think there's any point in describing it in the commit message. […]
Done
PS1:
I would avoid introducing new pre-processor conditionals, because we are planning to go in the oppos […]
I totally agree with all your and Alexander's propositions, however have no knowledge of how to test for header presence without preprocessor conditionals — whether it is C23's `__has_include()` check or autoconf's `HAVE_..._H` macro. I went for the latter and tried to adapt not only the Makefile (which I only care about currently), but meson.build as well (which I am not familiar with). While meson also succeeds on both my test systems with different software versions, it fails here on Jenkins, and I have no idea why.
File include/cli_classic.h:
https://review.coreboot.org/c/flashrom/+/77089/comment/04f51cfa_661cc65d : PS1, Line 21: #if !defined(__has_include) && (__STDC_VERSION__ < 202300L) : #include <getopt.h> : #define HAVE_GETOPT_H 1
If we cannot identify whether this header file exists on the user's system, then let's assume it doe […]
Done
https://review.coreboot.org/c/flashrom/+/77089/comment/07f97a7d_d7ff49a5 : PS1, Line 18: #if HAVE_GETOPT_H : #include <getopt.h> : #elif !defined(HAVE_GETOPT_H) : #if !defined(__has_include) && (__STDC_VERSION__ < 202300L) : #include <getopt.h> : #define HAVE_GETOPT_H 1 : #elif __has_include(<getopt.h>) : #include <getopt.h> : #define HAVE_GETOPT_H 1 : #else : #define HAVE_GETOPT_H 0 : #endif /* __has_include() */ : #endif /* HAVE_GETOPT_H */ : : #if !HAVE_GETOPT_H
Sorry it took me some time to get to this patch. […]
Done