util/nvramtool: fix building on OpenBSD

OpenBSD's gcc 4.2.1 doesn't know about _Noreturn

Change-Id: Ie9e1885c483941d3d0ce8c8948af53f1ef8bb5db
Signed-off-by: Evgeny Zinoviev <me@ch1p.io>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38348
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Idwer Vollering <vidwer@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Evgeny Zinoviev 2020-01-11 01:26:54 +03:00 committed by Patrick Georgi
parent b863468533
commit 79f7fcc927
2 changed files with 8 additions and 2 deletions

View File

@ -56,7 +56,7 @@ int get_line_from_file(FILE * f, char line[], int line_buf_size)
* *
* We ran out of memory. Print an error message and die. * We ran out of memory. Print an error message and die.
****************************************************************************/ ****************************************************************************/
_Noreturn void out_of_memory(void) noreturn void out_of_memory(void)
{ {
fprintf(stderr, "%s: Out of memory.\n", prog_name); fprintf(stderr, "%s: Out of memory.\n", prog_name);
exit(1); exit(1);

View File

@ -69,6 +69,12 @@ int win32_munmap(void *start, size_t length);
#define MAP_SHARED 1 #define MAP_SHARED 1
#endif #endif
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#define noreturn _Noreturn
#else
#define noreturn
#endif
/* basename of this program, as reported by argv[0] */ /* basename of this program, as reported by argv[0] */
extern const char prog_name[]; extern const char prog_name[];
@ -76,7 +82,7 @@ extern const char prog_name[];
extern const char prog_version[]; extern const char prog_version[];
int get_line_from_file(FILE * f, char line[], int line_buf_size); int get_line_from_file(FILE * f, char line[], int line_buf_size);
_Noreturn void out_of_memory(void); noreturn void out_of_memory(void);
void usage(FILE * outfile); void usage(FILE * outfile);
#endif /* COMMON_H */ #endif /* COMMON_H */