Windows builds expect `writev` symbol
FGasper opened this issue · 1 comments
FGasper commented
As reported at FGasper/p5-Net-LibNFS#11, builds against libnfs in Windows currently fail.
I can fix the issue by making this change:
diff --git a/include/win32/win32_compat.h b/include/win32/win32_compat.h
index 11ee4eb..578dc0f 100755
--- a/include/win32/win32_compat.h
+++ b/include/win32/win32_compat.h
@@ -162,7 +162,7 @@ struct iovec
void *iov_base;
};
-inline int writev(SOCKET sock, struct iovec *iov, int nvecs)
+static inline int writev(SOCKET sock, struct iovec *iov, int nvecs)
{
DWORD ret;
@@ -174,7 +174,7 @@ inline int writev(SOCKET sock, struct iovec *iov, int nvecs)
return -1;
}
-inline int readv(SOCKET sock, struct iovec *iov, int nvecs)
+static inline int readv(SOCKET sock, struct iovec *iov, int nvecs)
{
DWORD ret;
DWORD flags = 0;
… which causes dumpbin /SYMBOLS libnfs.a | Findstr writev
to go from:
002 00000000 SECT1 notype () Static | writev
002 00000000 SECT1 notype () Static | writev
01A 00000842 SECT1 notype () External | zdr_writeverf3
… to:
038 00000000 UNDEF notype () External | writev
03D 00000000 UNDEF notype () External | writev
01A 00000842 SECT1 notype () External | zdr_writeverf3
Is there any reason why this wouldn’t be an acceptable fix?
sahlberg commented
This has been merged