GNOME Bugzilla – Bug 494360
Enumerators conflict with windows-specific defines
Last modified: 2011-01-16 23:36:28 UTC
The following enumerators from libgnomevfsmm/enums.h conflict with defines from winerror.h, pulled in by winsock2.h, by libgnomevfs-address.h: ERROR_NOT_FOUND ERROR_NOT_SUPPORTED ERROR_ACCESS_DENIED ERROR_TOO_MANY_OPEN_FILES ERROR_FILE_EXISTS ERROR_CANCELLED ERROR_TOO_MANY_LINKS ERROR_TIMEOUT FILE_TYPE_UNKNOWN (this is from winbase.h) This prevents gnome-vfsmm from compiling on Windows. I'm not sure how to fix this. We can just undef them, but it may still happen that someone needs these windows-specific defines in gnome-vfsmm-using code. Perhaps we should rename the affected enumerations (using another prefix), keeping the old ones on non-Windows platforms.
Damned shitty windows code. Yes, please try to rename them for Windows, without breaking the API for existing platforms. Or just try not to use gnome-vfsmm on Windows if that's easier. That could even be a simple patch that isn't in svn, for the short-term, if it's difficult. We'll have to check if the new giomm has this problem too.
Created attachment 98925 [details] [review] Proposed patch This patch renames the problematic enums, and keeps the old names on non-Win32 platforms. It also disables a few methods that gnome-vfs does not implement on Win32. The patch does break neither ABI nor API on Linux, I was able to use and rebuild bakery and glom with this patch applied.
Applied to trunk, so it will be in the gnome-vfsmm 2.21.1 that I am just about to release.