]> git.mxchange.org Git - simgear.git/blobdiff - PUI/pu.cxx
More portability changes to help with windoze compilation problems.
[simgear.git] / PUI / pu.cxx
index ea197f7451aa1ccbc93e2c55455872d75e52918f..5e47cf054701261318f6f73f2742197b18bf6c43 100644 (file)
@@ -223,21 +223,23 @@ void  puInit ( void )
 
     int *tempSize = &fontSize[1];
 
-    if ( ! GetCharWidth32 ( hdc, 1, 255, tempSize ) )
+    if ( ! GetCharWidth32 ( hdc, 1, 255, tempSize ) &&
+         ! GetCharWidth   ( hdc, 1, 255, tempSize ) )
     {
       LPVOID lpMsgBuf ;
 
       FormatMessage ( FORMAT_MESSAGE_ALLOCATE_BUFFER |
-                      FORMAT_MESSAGE_FROM_SYSTEM,
-                     NULL,
-                     GetLastError(),
-                     MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-                     (LPTSTR) &lpMsgBuf,
-                     0, NULL ) ;
-
-      fprintf ( stderr, "PUI: Error: %s\n" (char *)lpMsgBuf ) ;
+                     FORMAT_MESSAGE_FROM_SYSTEM,
+                     NULL,
+                     GetLastError(),
+                     MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+                     (LPTSTR) &lpMsgBuf,
+                     0, NULL ) ;
+
+      fprintf ( stderr, "PUI: Error: %s\n", (char *)lpMsgBuf ) ;
       LocalFree ( lpMsgBuf ) ;
     }
+
     wglUseFontBitmaps ( hdc, 0, 256, fontBase ) ;
 #endif
   }