From: Alessandro P. <al...@ti...> - 2000-07-12 07:41:50
Attachments:
mesa32-diff.ZIP
|
Okay, i've put togheter all the fixes needed to make Mesa 3.2 work fine with MS VC 6.0 . These fixes have 3 (main) goals: 1) Avoid lots of compile warnings/errors (about 1.1MB of stdout ... ;) 2) Remove a link error during OPENGL32.DLL creation of the 3dfx/Mesa 3) Make 3DNOW, MMX, X86 (but also KATMAI for Mesa 3.3) optimizations work fine for both the normal and the 3dfx versions of Mesa 3.2 I've fixed makefiles, rules files and some includes and sources. I've slightly modified gl/gl.h : now this includes a new mesawin32.h include file if __WIN32__ is detected. mesawin32.h contains the complete list (about 25~30 pragmas) of all warning you have to disable in MSVC if you don't want to become insane during compiling. (Please note that the disabled-warnings have been tested only on MS-VC 6... I tried to make the list backward compatible, but I do not know if i succeeded : i only have the 6.0 version) I've prepared a diff file produced with DIFF 2.7.2 (for DOS) (command line used if diff -uNr dir2/Mesa-3.2 dir1/Mesa-3.2 -- dir2 contained the ORIGINAL Mesa 3.2 AND Mesa Demos 3.2, dir1 contained my patched version of both Mesa 3.2 and MesaDemos 3.2). I applied the patch with PATCH 2.5.4 (for DOS) with the commandline: patch -p1 -f < mesa32.diff to a clean-original Mesa3.2 + MesaDemos3.2, then recompiled all the stuff (static libs, DLLs, Demos, 3dfx demos, book-samples, ...) via mesaw32.bat and all works fine for me. Note for Brian and Mesa 3.2.1: Brian, I'm sorry for breking you work but please apply this patch insted of files I posted some days ago: i made other changes on them. Okay...that's all... and Hope That Helps ;) Bye, TXM |
From: Brian P. <br...@va...> - 2000-07-12 14:45:15
|
Alessandro Pisani wrote: > > Okay, i've put togheter all the fixes needed to make Mesa 3.2 work fine > with MS VC 6.0 . These fixes have 3 (main) goals: > 1) Avoid lots of compile warnings/errors (about 1.1MB of stdout ... ;) > 2) Remove a link error during OPENGL32.DLL creation of the 3dfx/Mesa > 3) Make 3DNOW, MMX, X86 (but also KATMAI for Mesa 3.3) optimizations work > fine for both the normal and the 3dfx versions of Mesa 3.2 > > I've fixed makefiles, rules files and some includes and sources. I've > slightly modified gl/gl.h : now this includes a new mesawin32.h include > file if __WIN32__ is detected. mesawin32.h contains the complete list > (about 25~30 pragmas) of all warning you have to disable in MSVC if you > don't want to become insane during compiling. > (Please note that the disabled-warnings have been tested only on MS-VC 6... > I tried to make the list backward compatible, but I do not know if i > succeeded : i only have the 6.0 version) > > I've prepared a diff file produced with DIFF 2.7.2 (for DOS) (command line > used if diff -uNr dir2/Mesa-3.2 dir1/Mesa-3.2 -- dir2 contained the > ORIGINAL Mesa 3.2 AND Mesa Demos 3.2, dir1 contained my patched version of > both Mesa 3.2 and MesaDemos 3.2). > > I applied the patch with PATCH 2.5.4 (for DOS) with the commandline: patch > -p1 -f < mesa32.diff to a clean-original Mesa3.2 + MesaDemos3.2, then > recompiled all the stuff (static libs, DLLs, Demos, 3dfx demos, > book-samples, ...) via mesaw32.bat and all works fine for me. > > Note for Brian and Mesa 3.2.1: Brian, I'm sorry for breking you work but > please apply this patch insted of files I posted some days ago: i made > other changes on them. I have a few problems with this. 1. You introduce a new include/GL/mesawin32.h header. The headers in include/GL are meant to be public interfaces. Your header just has a bunch of MSVC pragmas for compiling Mesa. This should probably be moved to the src/ directory. 2. When I tried to apply your patch, many of the patches failed since the latest 3.2 CVS files are different from the released 3.2 distro. Can you download the latest files from CVS and try again? 3. It would be best if you used the CVS sources since you could then test/update Mesa 3.3 which will be released soon. -Brian |
From: Stephen J B. <sj...@li...> - 2000-07-12 17:44:58
|
On Wed, 12 Jul 2000, Brian Paul wrote: > I have a few problems with this. > > 1. You introduce a new include/GL/mesawin32.h header. The headers in > include/GL are meant to be public interfaces. Your header just has > a bunch of MSVC pragmas for compiling Mesa. This should probably be > moved to the src/ directory. Certainly the gl.h header has no business turning off warnings in application programs! Yikes! This needs to be included into a private Mesa header file. Steve Baker (817)619-2657 (Vox/Vox-Mail) L3Com/Link Simulation & Training (817)619-2466 (Fax) Work: sj...@li... http://www.link.com Home: sjb...@ai... http://web2.airmail.net/sjbaker1 |
From: Alessandro P. <al...@ti...> - 2000-07-12 20:26:54
|
At 19.30 12/07/00, you wrote: >Certainly the gl.h header has no business turning off warnings in application >programs! Yikes! > >This needs to be included into a private Mesa header file. Please take a look to the resulting gl.h and the actual gl.h : the actual one does YET contains warning turns-off. Moreover, the resulting gl.h does not contains these turn-off AT ALL: I moved them in another file. So: look-BEFORE-say "Yikes!", please. --- cut from GL.H of Mesa 3.2 OFFICIAL (not patched by me) --- #if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__)) # pragma warning( disable : 4068 ) /* unknown pragma */ # pragma warning( disable : 4710 ) /* function 'foo' not inlined */ # pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */ # pragma warning( disable : 4127 ) /* conditional expression is constant */ # if defined(MESA_MINWARN) # pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ # pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ # pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ # pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */ # pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ # endif # if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ # define GLAPI __declspec(dllexport) # define WGLAPI __declspec(dllexport) --- end cut --- TXM |
From: Brian P. <br...@va...> - 2000-07-12 20:42:48
|
Alessandro Pisani wrote: > > At 19.30 12/07/00, you wrote: > >Certainly the gl.h header has no business turning off warnings in application > >programs! Yikes! > > > >This needs to be included into a private Mesa header file. > Please take a look to the resulting gl.h and the actual gl.h : the actual > one does YET contains warning turns-off. Moreover, the resulting gl.h does > not contains these turn-off AT ALL: I moved them in another file. > So: look-BEFORE-say "Yikes!", please. > > --- cut from GL.H of Mesa 3.2 OFFICIAL (not patched by me) --- > #if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__)) > # pragma warning( disable : 4068 ) /* unknown pragma */ > # pragma warning( disable : 4710 ) /* function 'foo' not inlined */ > # pragma warning( disable : 4711 ) /* function 'foo' selected for > automatic inline expansion */ > # pragma warning( disable : 4127 ) /* conditional expression is constant */ > # if defined(MESA_MINWARN) > # pragma warning( disable : 4244 ) /* '=' : conversion from 'const > double ' to 'float ', possible loss of data */ > # pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ > # pragma warning( disable : 4305 ) /* '=' : truncation from 'const > double ' to 'float ' */ > # pragma warning( disable : 4550 ) /* 'function' undefined; > assuming extern returning int */ > # pragma warning( disable : 4761 ) /* integral size mismatch in > argument; conversion supplied */ > # endif > # if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're > building mesa as a DLL */ > # define GLAPI __declspec(dllexport) > # define WGLAPI __declspec(dllexport) > --- end cut --- In 3.2, gl.h was issuing pragmas. In 3.3 I moved them into the internal glheader.h file. -Brian |
From: Alessandro P. <al...@ti...> - 2000-07-12 20:19:25
|
At 15.42 12/07/00, Brian Paul wrote: >I have a few problems with this. > >1. You introduce a new include/GL/mesawin32.h header. The headers in > include/GL are meant to be public interfaces. Your header just has > a bunch of MSVC pragmas for compiling Mesa. This should probably be > moved to the src/ directory. >2. When I tried to apply your patch, many of the patches failed since the >latest 3.2 CVS files are different from the released 3.2 distro. >Can you download the latest files from CVS and try again? >3. It would be best if you used the CVS sources since you could then > test/update Mesa 3.3 which will be released soon. Mhh...okay: I'll apply them on the latest Mesa 3.3-CVS... but before this we've to find a hack for the problem #1... i think moving mesawin32.h into /src is complicated : you also have to put something like: #ifdef __WIN32__ #include "mesawin32.h" #endif (note that __WIN32__ is defined in gl.h so this code-fragment must be put after include <GL/gl.h> ) in EACH source-file of these dir: /src, /src/FX, /src/FX/X86, /src/X86, /demos, /3dfx/demos, /book etc, etc... Please also note that you have to add the code-fragment above in every new file you create in Mesa (this is for future), so I think this is not an efficient method... is it? I don't know enough about the Mesa internal structure to find a better solution, but if you find a better method (and I'm sure there's one), I'll be happy to test it with MS-VC 6.0 ;) TXM |
From: Brian P. <br...@va...> - 2000-07-12 20:25:28
|
Alessandro Pisani wrote: > > At 15.42 12/07/00, Brian Paul wrote: > >I have a few problems with this. > > > >1. You introduce a new include/GL/mesawin32.h header. The headers in > > include/GL are meant to be public interfaces. Your header just has > > a bunch of MSVC pragmas for compiling Mesa. This should probably be > > moved to the src/ directory. > >2. When I tried to apply your patch, many of the patches failed since the > >latest 3.2 CVS files are different from the released 3.2 distro. > >Can you download the latest files from CVS and try again? > >3. It would be best if you used the CVS sources since you could then > > test/update Mesa 3.3 which will be released soon. > > Mhh...okay: I'll apply them on the latest Mesa 3.3-CVS... but before this > we've to find a hack for the problem #1... i think moving mesawin32.h into > /src is complicated : you also have to put something like: > > #ifdef __WIN32__ > #include "mesawin32.h" > #endif > > (note that __WIN32__ is defined in gl.h so this code-fragment must be put > after include <GL/gl.h> ) > > in EACH source-file of these dir: /src, /src/FX, /src/FX/X86, /src/X86, > /demos, /3dfx/demos, /book etc, etc... > Please also note that you have to add the code-fragment above in every new > file you create in Mesa (this is for future), so I think this is not an > efficient method... is it? In Mesa 3.3 there's a new src/glheader.h file which is meant to be the place to put this sort of thing. It's included by all other source files. You should put your pragmas in that file. > I don't know enough about the Mesa internal structure to find a better > solution, but if you find a better method (and I'm sure there's one), I'll > be happy to test it with MS-VC 6.0 ;) I'm really happy you're doing this work. I just want to be sure it's done cleanly. -Brian |