summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2019-11-04 01:08:53 +0100
committerKamil Rytarowski <n54@gmx.com>2019-11-04 01:08:53 +0100
commite345bc6e65a3a7b8797a0e8322771cf1a3ef1213 (patch)
tree8060460dbfffa5fbdb789ef62d37648633e86a9b
parent52efd673692a863aa1a6195396550e97d0be8917 (diff)
downloadbcm5719-llvm-e345bc6e65a3a7b8797a0e8322771cf1a3ef1213.tar.gz
bcm5719-llvm-e345bc6e65a3a7b8797a0e8322771cf1a3ef1213.zip
[compiler-rt] [msan] Support POSIX iconv(3) on NetBSD 9.99.17+
Fixes build of test.
-rw-r--r--compiler-rt/test/msan/iconv.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/compiler-rt/test/msan/iconv.cpp b/compiler-rt/test/msan/iconv.cpp
index e2d08e9afe7..eeeff9a3b0c 100644
--- a/compiler-rt/test/msan/iconv.cpp
+++ b/compiler-rt/test/msan/iconv.cpp
@@ -8,6 +8,15 @@
#include <stdio.h>
#include <errno.h>
+#if defined(__NetBSD__)
+#include <sys/param.h>
+#if __NetBSD_Prereq__(9,99,17)
+#define NETBSD_POSIX_ICONV 1
+#else
+#define NETBSD_POSIX_ICONV 0
+#endif
+#endif
+
int main(void) {
iconv_t cd = iconv_open("ASCII", "ASCII");
assert(cd != (iconv_t)-1);
@@ -15,7 +24,7 @@ int main(void) {
char inbuf_[100];
strcpy(inbuf_, "sample text");
char outbuf_[100];
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) && !NETBSD_POSIX_ICONV
// Some OSes expect the 2nd argument of iconv(3) to be of type const char **
const char *inbuf = inbuf_;
#else
OpenPOWER on IntegriCloud