Index: packages/cpp/SWI-cpp2.h
--- packages/cpp/SWI-cpp2.h.orig
+++ packages/cpp/SWI-cpp2.h
@@ -1667,6 +1667,7 @@ class PlStream (public)
   int lock();
   int tryLock();
   int unlock();
+#undef fileno
   int fileno();
   // int	closehook(void (*hook)(IOSTREAM *s));
   void	setbuffer(char *buf, size_t size);
