
Nmap Development mailing list archives
Re: [Patch] 'static inline' and MSVC
From: Henri Doreau <henri.doreau () gmail com>
Date: Wed, 12 Feb 2014 10:18:08 +0100
2014-02-12 10:04 GMT+01:00 Gisle Vanem <gvanem () yahoo no>:
The new 'static inline' functions in nbase.h breaks my MSVC v16 build. E.g. static inline int checked_fd_isset ( ... MSVC v16 has no 'inline' in C, but '__inline'. Not sure if a more recent MSVC has a native 'inline'. Looking at how libpcap does this, I don't think so. A patch that works for me: --- svn-latest/nbase/nbase.h 2014-02-10 05:12:34 +0000 +++ nbase/nbase.h 2014-02-12 09:05:12 +0000 @@ -368,6 +368,9 @@ #define DEVNULL "/dev/null" #endif +#if defined(_MSC_VER) && !defined(__cplusplus) && !defined(inline) +#define inline __inline +#endif static inline int checked_fd_isset(int fd, const fd_set *fds) { #ifndef WIN32 --gv
Thanks Gisle, My bad, I wasn't expecting this to break anything. How does MSVC deal w/ the inline functions that are defined in nsock_internal.h[1] for instance? We don't compile nsock as C++, do we? Your patch seems good to me. Any concern from a Windows developer? Regards [1] https://svn.nmap.org/nmap/nsock/src/nsock_internal.h -- Henri _______________________________________________ Sent through the dev mailing list http://nmap.org/mailman/listinfo/dev Archived at http://seclists.org/nmap-dev/
Current thread:
- [Patch] 'static inline' and MSVC Gisle Vanem (Feb 12)
- Re: [Patch] 'static inline' and MSVC Henri Doreau (Feb 12)
- Re: [Bulk] Re: [Patch] 'static inline' and MSVC Gisle Vanem (Feb 12)
- Re: [Bulk] Re: [Patch] 'static inline' and MSVC Henri Doreau (Feb 24)
- Re: [Bulk] Re: [Patch] 'static inline' and MSVC Gisle Vanem (Feb 12)
- Re: [Patch] 'static inline' and MSVC Henri Doreau (Feb 12)