[Xcb-commit] win32port.mdwn

XCB site xcb at freedesktop.org
Sat Jun 20 11:11:18 PDT 2009


 win32port.mdwn |   26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

New commits:
commit 84716d062ecaf29a860276dadea961c4351b6899
Author: Jatin <Jatin at web>
Date:   Sat Jun 20 11:11:17 2009 -0700

diff --git a/win32port.mdwn b/win32port.mdwn
index 7dce37a..f15100d 100644
--- a/win32port.mdwn
+++ b/win32port.mdwn
@@ -45,10 +45,8 @@ Our code has been changed to skip inclusion of these header files when compiled
     * \_xcb\_open\_unix() : Preprocessor directives prevent this from being compiled while building for Win32.
     * \_xcb\_open() : Does not call _xcb_open_unix for Win32 build.
     * \_xcb\_open\_tcp() : Calls initWSA to initialize the Windows Socket Architecture. 
-    * initWSA() : New function added to initialize the Win32 Sockets layer.
 
 * xcb.h
-    * Declaration for the initWSA function added.
 
 * windefs.h (new header created specifically for the Win32 port)
 
@@ -100,6 +98,7 @@ If all goes well the DLL is created within the src/.libs directory.
 
 ## Where can I get this from now?
 
+
 ***
 
 Until this port is merged into the main tree, I have set up a git branch of XCB with changes to support a Win32 build. Get it using :
@@ -121,6 +120,8 @@ The simplest way to use the DLL under MinGW is to include it during compiling yo
 
      i586-mingw32msvc-gcc xcbclient.c libxcb-1.dll -o xcbclient.exe
 
+NOTE: Initialization ( using WSAStarup() ) and Cleanup ( WSACleanup() ) of the Windows Socket Library needs to be performed by the calling application prior to using this library.
+
 ## X Servers
 ***
 
@@ -144,6 +145,8 @@ The following is a test code from the XCB tutorial. Copy all of the XCB headers
     #define WIDTH 300
     #define HEIGHT 150
 
+    int initWSA(void);
+
     static xcb_gc_t
         getFontGC (xcb_connection_t *connection,
                xcb_screen_t     *screen,
@@ -339,6 +342,15 @@ The following is a test code from the XCB tutorial. Copy all of the XCB headers
        
 
         int screenNum,i;
+        int rc;
+        
+        rc = initWSA();
+        if(rc != 0)
+          {
+          fprintf(stderr,"Unable to load Winsock: %d\n",rc);
+          return 1;
+          }
+        
         xcb_connection_t *connection = xcb_connect ("127.0.0.1:0.0", &screenNum);
         if (!connection) {
             fprintf (stderr, "ERROR: can't connect to an X server\n");
@@ -463,3 +475,13 @@ The following is a test code from the XCB tutorial. Copy all of the XCB headers
 
         return 0;
     }
+
+    int initWSA(void)
+    {
+        WSADATA wsd;
+        int rc;
+     
+        rc = WSAStartup(MAKEWORD(2,2),&wsd);
+      
+        return rc;
+    }       


More information about the xcb-commit mailing list