Undeclared identifier EOPNOTSUPP under win32 #183

Closed
nnposter opened this Issue Jul 7, 2015 · 2 comments

Comments

Projects
None yet
2 participants

nnposter commented Jul 7, 2015

Compilation of r34854 with Visual Studio 2010 fails with

service_scan.cc(2559): error C2065: 'EOPNOTSUPP' : undeclared identifier

The root cause appears to be the absence of the corresponding definition in nbase/nbase_winunix.h. The following patch rectifies the issue:

--- a/nbase/nbase_winunix.h 2015-06-28 10:49:40.000000000 -0600
+++ b/nbase/nbase_winunix.h 2015-07-06 18:10:35.876970500 -0600
@@ -242,6 +242,8 @@
 #define ENOBUFS         WSAENOBUFS     /* No buffer space available */
 #undef EMSGSIZE
 #define EMSGSIZE        WSAEMSGSIZE    /* Message too long */
+#undef EOPNOTSUPP
+#define EOPNOTSUPP      WSAEOPNOTSUPP  /* Operation not supported */
 #undef  ENOMEM
 #define ENOMEM          WSAENOBUFS
 #undef  ENOTSOCK

@nnposter We skipped over VS 2010 in our own builds, so we did not encounter this problem, but we ran into other problems on VS 2013. As a workaround, we added the _MSC_VER check in nbase_winunix.h which seems to be working well. Could you try changing the version there from "1800" (VS 2013) to "1600" (VS 2010) and see if it solves the problem? Otherwise, we'll apply your fix.

nnposter commented Jul 7, 2015

Sourcing errno.h (by changing the _MSC_VER condition) takes care of the missing EOPNOTSUPP but it exposes the class/struct bug that Gisle recently reported, which was until then latent. Applying his fix makes everything compile without errors.

It seems to me that perhaps both changes (the conditional and the custom definition) should be applied. Otherwise we would not be treating the error codes consistently, such as EOPNOTSUPP vs EMSGSIZE.

nmap-bot closed this in 2056a30 Jul 8, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment