diff --git a/src/xpdev/filewrap.h b/src/xpdev/filewrap.h
index 3aa5f2b7576ed6e754afdc5fd8eeceb0aaef0849..dba8080831266829b1cd9c7fde1ee83c30559cdf 100644
--- a/src/xpdev/filewrap.h
+++ b/src/xpdev/filewrap.h
@@ -121,7 +121,9 @@
 
 	#define chsize(fd,size)		ftruncate(fd,size)
 	#define tell(fd)			lseek(fd,0,SEEK_CUR)
-	#define eof(fd)				(tell(fd)==filelength(fd))
+	#ifndef __cplusplus	// Conflict with FreeBSD /usr/include/c++/v1/iterator
+		#define eof(fd)			(tell(fd)==filelength(fd))
+	#endif
 
 #elif defined(__OS2__)