FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

patch for DMD 1.20

 
Post new topic   Reply to topic     Forum Index -> Schooner
View previous topic :: View next topic  
Author Message
baxissimo



Joined: 23 Oct 2006
Posts: 241
Location: Tokyo, Japan

PostPosted: Wed Aug 08, 2007 11:48 pm    Post subject: patch for DMD 1.20 Reply with quote

This patch gets the current svn rev (45) working with DMD 1.20.

It also changes things a bit so that if you build using -version=useDerelict it will create some of the libs with the names like gld-derelict.lib and fonts-derelict.lib.

If you don't like that last change then just revert all the buildme.d files after applying the patch. Anyway, some way to have both useDerelict and plain versions compiled simultaneously is needed.
Back to top
View user's profile Send private message
baxissimo



Joined: 23 Oct 2006
Posts: 241
Location: Tokyo, Japan

PostPosted: Wed Aug 08, 2007 11:50 pm    Post subject: Attachment Reply with quote

Code:

Index: fonts/buildme.d
===================================================================
--- fonts/buildme.d   (revision 45)
+++ fonts/buildme.d   (working copy)
@@ -59,10 +59,12 @@
     }
   }
 
+  char[] libFile = "fonts";
+  if (useDerelict) { libFile ~= "-derelict"; }
   version (Windows) {
-    char[] libFile = "fonts.lib";
+      libFile ~= ".lib";
   } else {
-    char[] libFile = "fonts.a";
+      libFile ~= ".a";
   }
   char[][] includes;
   char[][] versions;
@@ -160,7 +162,12 @@
   char[][] libs; // libraries linked by flag reference (example, -lGL)
   libraries ~= libFile;
   version(Windows) {
-    libraries ~= std.path.join(gldDir, "gld.lib");
+      if (useDerelict) {
+          libraries ~= std.path.join(gldDir, "gld-derelict.lib");
+      }
+      else {
+          libraries ~= std.path.join(gldDir, "gld.lib");
+      }
     version (DigitalMars) {
       libraries ~= std.path.join(freetypeDir, "freetype_dmc.lib");
       libraries ~= std.path.join(freetypeDir, "freetype_dmd.lib");
@@ -190,7 +197,12 @@
       libs ~= "winmm";
     }
   } else version (linux) {
-    libraries ~= std.path.join(gldDir, "gld.a");
+    if (useDerelict) {
+      libraries ~= std.path.join(gldDir, "gld-derelict.a");
+    }
+    else {
+      libraries ~= std.path.join(gldDir, "gld.a");
+    }
     libraries ~= std.path.join(freetypeDir, "freetype_gcc.a");
     version (DigitalMars) {
       libraries ~= std.path.join(freetypeDir, "freetype_dmd.a");
Index: fonts/source/fonts/ftvectoriser.d
===================================================================
--- fonts/source/fonts/ftvectoriser.d   (revision 45)
+++ fonts/source/fonts/ftvectoriser.d   (working copy)
@@ -938,11 +938,8 @@
         }
 }
 
-version(Windows) {
-   extern(Windows):
-} else {
-   extern(C):
-}
+extern(System):
+
 void ftglErrorNoData( GLenum errCode)
 {
 }
Index: gl/source/gl.d
===================================================================
--- gl/source/gl.d   (revision 45)
+++ gl/source/gl.d   (working copy)
@@ -15,15 +15,9 @@
  ************************************************************************/
 
 
-version (Win32) {
-    extern (Windows):
-}
-version (linux) {
-    extern (C):
-}
+extern (System):
 
 
-
 /************************************************************************
  *
  * OpenGL versions supported by this module (1.0 is assumed, and requires
@@ -887,7 +881,7 @@
 void glClear( GLbitfield mask );
 void glIndexMask( GLuint mask );
 void glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha );
-void glAlphaFunc( GLenum func, GLclampf ref );
+void glAlphaFunc( GLenum func, GLclampf refr );
 void glBlendFunc( GLenum sfactor, GLenum dfactor );
 void glLogicOp( GLenum opcode );
 void glCullFace( GLenum mode );
@@ -1147,7 +1141,7 @@
 void glCopyPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum type );
 
 /* Stenciling */
-void glStencilFunc( GLenum func, GLint ref, GLuint mask );
+void glStencilFunc( GLenum func, GLint refr, GLuint mask );
 void glStencilMask( GLuint mask );
 void glStencilOp( GLenum fail, GLenum zfail, GLenum zpass );
 void glClearStencil( GLint s );
@@ -3859,7 +3853,7 @@
 typedef void (* PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
 
 /* GL_EXT_index_func */
-typedef void (* PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
+typedef void (* PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf refr);
 
 /* GL_EXT_compiled_vertex_array */
 typedef void (* PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
Index: gl/source/glu.d
===================================================================
--- gl/source/glu.d   (revision 45)
+++ gl/source/glu.d   (working copy)
@@ -12,12 +12,7 @@
 import gl;
 
 
-version (Win32) {
-    extern (Windows):
-}
-version (linux) {
-    extern (C):
-}
+extern (System):
 
 
 /************************************************************************
Index: gld/buildme.d
===================================================================
--- gld/buildme.d   (revision 45)
+++ gld/buildme.d   (working copy)
@@ -64,8 +64,10 @@
 
   version (Windows) {
     char[] libFile = "gld.lib";
+    if (useDerelict) libFile = "gld-derelict.lib";
   } else {
     char[] libFile = "gld.a";
+    if (useDerelict) libFile = "gld-derelict.a";
   }
   char[][] includes;
   char[][] versions;
Index: gld/source/gld_/win32/window.d
===================================================================
--- gld/source/gld_/win32/window.d   (revision 45)
+++ gld/source/gld_/win32/window.d   (working copy)
@@ -879,7 +879,7 @@
 
     // Get a rendering context
     version (useDerelict) {
-      _gldWin.RC = cast(win32.winnt.HANDLE)derelict.opengl.wgl.wglCreateContext(cast(std.c.windows.windows.HANDLE)_gldWin.DC);
+      _gldWin.RC = cast(win32.winnt.HANDLE)derelict.opengl.wgl.wglCreateContext(cast(derelict.util.wintypes.HANDLE)_gldWin.DC);
     } else {
       _gldWin.RC = wglCreateContext(_gldWin.DC);
     }
@@ -892,7 +892,7 @@
     // Activate the OpenGL rendering context
     bool madeCurrent = false;
     version (useDerelict) {
-      madeCurrent = 0 != derelict.opengl.wgl.wglMakeCurrent( cast(std.c.windows.windows.HANDLE)_gldWin.DC, cast(std.c.windows.windows.HANDLE)_gldWin.RC );
+      madeCurrent = 0 != derelict.opengl.wgl.wglMakeCurrent( cast(derelict.util.wintypes.HANDLE)_gldWin.DC, cast(derelict.util.wintypes.HANDLE)_gldWin.RC );
     } else {
       madeCurrent = 0 != wglMakeCurrent( _gldWin.DC, _gldWin.RC );
     }
@@ -938,7 +938,7 @@
           derelict.opengl.wgl.wglMakeCurrent( null, null );
   
           // Delete the rendering context
-          derelict.opengl.wgl.wglDeleteContext( cast(std.c.windows.windows.HANDLE)_gldWin.RC );
+          derelict.opengl.wgl.wglDeleteContext( cast(derelict.util.wintypes.HANDLE)_gldWin.RC );
         } else {
           // Release the DC and RC contexts
           wglMakeCurrent( null, null );
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Schooner All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group