Fix WIN32 compilation after commit 163c47bdc0d32785d831e4c93fea9ab7e023446b
[free-sw/xcb/libxcb] / src / xcb_util.c
index fcb11f0..64a1f6d 100644 (file)
 #include <stddef.h>
 #include <unistd.h>
 #include <string.h>
-#include <arpa/inet.h>
 
 #ifdef _WIN32
 #include "xcb_windefs.h"
 #else
+#include <arpa/inet.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <netinet/in.h>
@@ -424,13 +424,13 @@ xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname,
     int parsed = _xcb_parse_display(displayname, &host, &protocol, &display, screenp);
     
     if(!parsed) {
-        c = (xcb_connection_t *) &error_connection;
+        c = _xcb_conn_ret_error(XCB_CONN_CLOSED_PARSE_ERR);
         goto out;
     } else
         fd = _xcb_open(host, protocol, display);
 
     if(fd == -1) {
-        c = (xcb_connection_t *) &error_connection;
+        c = _xcb_conn_ret_error(XCB_CONN_ERROR);
         goto out;
     }