path: root/flash.h
diff options
authorStefan Tauner <>2015-01-27 18:07:50 +0000
committerStefan Tauner <>2015-01-27 18:07:50 +0000
commitdc627931848ed6af40be4f7d5bdb8e33d28b8333 (patch)
tree8a458f2a546da385a13b3662586000286e3aa02d /flash.h
parent0cbd8c2558209432a0f51522cd2adffc59785dd0 (diff)
Make strnlen() visible in old versions of glibc
Strnlen() is in POSIX 2008 but was a GNU extension up to glibc 2.10 requiring to define _GNU_SOURCE. This fixes compilation on CentOS 4.9. Also, move our implementation of strnlen() that was added to support DJGPP to helpers.c. Corresponding to flashrom svn r1878. Signed-off-by: Stefan Tauner <> Acked-by: Carl-Daniel Hailfinger <>
Diffstat (limited to 'flash.h')
1 files changed, 3 insertions, 0 deletions
diff --git a/flash.h b/flash.h
index 56d9e4b..5fb743d 100644
--- a/flash.h
+++ b/flash.h
@@ -260,6 +260,9 @@ void tolower_string(char *str);
#ifdef __MINGW32__
char* strtok_r(char *str, const char *delim, char **nextp);
+#if defined(__DJGPP__)
+size_t strnlen(const char *str, size_t n);
/* flashrom.c */
extern const char flashrom_version[];
OpenPOWER on IntegriCloud