Re: [PATCH] Fixed compilation with Visual Studio by including poll.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Windows does not have sys/poll.h. I have to use the one from compat/win32.

The problem is that
    NO_SYS_POLL_H
is defined in compat/msvc.h in my environment.
And in git-compat-util.h
    #ifndef NO_SYS_POLL_H
    #include <sys/poll.h>
    #else
    #include <poll.h>
    #endif
is before
    #elif defined(_MSC_VER)
    #include "compat/msvc.h"
. Moving it down, solves the issue for me. (Suppose this is a fix for my
scenario only).

diff --git a/git-compat-util.h b/git-compat-util.h
index ed11ad8..a96849c 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -111,11 +111,6 @@
 #include <regex.h>
 #include <utime.h>
 #include <syslog.h>
-#ifndef NO_SYS_POLL_H
-#include <sys/poll.h>
-#else
-#include <poll.h>
-#endif
 #if defined(__MINGW32__)
 /* pull in Windows compatibility stuff */
 #include "compat/mingw.h"
@@ -152,6 +147,11 @@
 #define _ALL_SOURCE 1
 #endif
 #endif
+#ifndef NO_SYS_POLL_H
+#include <sys/poll.h>
+#else
+#include <poll.h>
+#endif

 #ifndef NO_LIBGEN_H
 #include <libgen.h>
-- 
Best regards,
 Sven Strickroth
 ClamAV, a GPL anti-virus toolkit   http://www.clamav.net
 PGP key id F5A9D4C4 @ any key-server
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]