]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
include: Allow for our md5.h to defer to the system header
authorGerald Pfeifer <gerald@pfeifer.com>
Fri, 5 Nov 2021 11:56:07 +0000 (12:56 +0100)
committerGerald Pfeifer <gerald@pfeifer.com>
Fri, 5 Nov 2021 12:06:34 +0000 (13:06 +0100)
This came up in the context of libsanitizer, where platform-specific
support for FreeBSD relies on aspects provided by FreeBSD's own md5.h.

Address this by allowing GCC's md5.h to pull in the system header
instead, controlled by a new macro USE_SYSTEM_MD5.

2021-11-05  Gerald Pfeifer  <gerald@pfeifer.com>
    Jakub Jelinek  <jakub@redhat.com>

include/
* md5.h (USE_SYSTEM_MD5): Introduce.

include/md5.h

index 03f7d29afc757358e4b3faba260d3d23c578e51f..c5bb60769694eafaaddcdd6d473c4580bc46ea2d 100644 (file)
 #ifndef _MD5_H
 #define _MD5_H 1
 
+#ifdef USE_SYSTEM_MD5
+#include_next <md5.h>
+#else
+
 #include <stdio.h>
 
 #if defined HAVE_LIMITS_H || _LIBC
@@ -151,4 +155,6 @@ extern void *md5_buffer (const char *buffer, size_t len, void *resblock);
 }
 #endif
 
+#endif // USE_SYSTEM_MD5
+
 #endif