+++ ./liboctave/wrappers/pwd-wrappers.c
@@ -32,6 +32,15 @@
 
 #if defined (HAVE_PWD_H)
 #  include <pwd.h>
+#  ifdef getpwnam
+#  undef getpwnam
+#  endif
+#  ifdef getpwuid
+#  undef getpwuid
+#  endif
+#  ifdef getpwuid_r
+#  undef getpwuid_r
+#  endif
 #endif
 
 #include "pwd-wrappers.h"
