patacongo commented on pull request #39:
URL:
https://github.com/apache/incubator-nuttx-testing/pull/39#issuecomment-699687016
>
>
> This is probably real code breakage. Again, it is a screw-up in include
paths:
>
> ```
> /usr/include/cygwin/socket.h:27:8: error: redefinition of 'struct sockaddr'
> 27 | struct sockaddr {
> | ^~~~~~~~
> In file included from /usr/include/w32api/winsock2.h:57,
> from sim/up_wpcap.c:48:
> /usr/include/w32api/psdk_inc/_ip_types.h:70:8: note: originally defined
here
> 70 | struct sockaddr {
> | ^~~~~~~~
> In file included from /usr/include/sys/socket.h:13,
> from /usr/include/cygwin/in.h:21,
> from /usr/include/netinet/in.h:12,
> from sim/up_wpcap.c:57:
> /usr/include/cygwin/socket.h:39:8: error: redefinition of 'struct
sockaddr_storage'
> 39 | struct sockaddr_storage {
> | ^~~~~~~~~~~~~~~~
> In file included from sim/up_wpcap.c:48:
> /usr/include/w32api/winsock2.h:269:10: note: originally defined here
> 269 | struct sockaddr_storage {
> | ^~~~~~~~~~~~~
> ```
>
> sim_wcap.c hasn't been build in ages. It is mixing Cygwin and Windows
socket definitions. As I recall, this is a host file and, hence should be using
all Windows definitions.
>
> The likelihood that this still works (even if built correctly) is low.
>
> I will look into this too.
This was, I am pretty sure, introduced with commit:
8ce0ff5ce44416511be343c842c8d714687182cf with this change:
diff --git a/arch/sim/src/sim/up_wpcap.c b/arch/sim/src/sim/up_wpcap.c
index ef7b4b3a0c..a15421e80c 100644
--- a/arch/sim/src/sim/up_wpcap.c
+++ b/arch/sim/src/sim/up_wpcap.c
@@ -55,6 +55,8 @@
#include <netinet/in.h>
+#include "up_internal.h"
+
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
up_internal.h includes:
47 # include <sys/types.h>
48 # include <stdbool.h>
49 # include <netinet/in.h>
And netinet/in.h includes:
46 #include <sys/types.h>
47 #include <sys/socket.h>
48 #include <stdint.h>
Which is where the collision error is introduced since up_wpcap.c includes
winsock2.h already. The solution: Revert that single file change.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]