Re: [AD] scanexp.c problems (and patch)

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2008-08-10, Trent Gamblin <trent@xxxxxxxxxx> wrote:
> I just compiled Allegro on a clean PC to test something on XP. I
> ended up having to modify scanexp.c to get allegro.def generated
> properly. I'm just not sure of the patch. It's attached. Does it
> look ok? I'm not sure why I didn't have the problem before.
> 
> Trent :{)>
> Index: misc/scanexp.c
> ===================================================================
> --- misc/scanexp.c	(revision 10333)
> +++ misc/scanexp.c	(working copy)
> @@ -3,6 +3,7 @@
>   *
>   *  By Michael Rickmann.
>   */
> +#define SCAN_DEPEND
>  
>  
>  #define AL_VAR(type, name)                   allexpvar name##_sym
> @@ -28,7 +29,7 @@
>  #elif defined ALLEGRO_WINAPI
>  
>     #define ALLEGRO_H
> -   #include "allegro5/platform/alplatf.h"
> +   //#include "allegro5/platform/alplatf.h"
>     #include "allegro5/winalleg.h"
>     #include "allegro5/platform/alwin.h"

This broke misc/fixdll.sh on Unix as it would try to include <d3d9.h>
which obviously doesn't exist.  What about this patch?  The al_d3d_* symbols
appear in allegro.def and it built fine with a cross compiler.


diff --git a/include/allegro5/winalleg.h b/include/allegro5/winalleg.h
index e8e8120..aaf3154 100644
--- a/include/allegro5/winalleg.h
+++ b/include/allegro5/winalleg.h
@@ -113,8 +113,11 @@ AL_FUNC(void, stretch_blit_from_hdc, (HDC hdc, BITMAP *bitmap, int src_x, int sr
 /* D3D stuff */
 
 
-#if defined(SCAN_DEPEND) || defined(ALLEGRO_CFG_D3D)
+#if defined(ALLEGRO_CFG_D3D)
+
+#ifndef SCAN_DEPEND
 #include <d3d9.h>
+#endif
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/misc/scanexp.c b/misc/scanexp.c
index 3287db9..6fadbc5 100644
--- a/misc/scanexp.c
+++ b/misc/scanexp.c
@@ -3,6 +3,8 @@
  *
  *  By Michael Rickmann.
  */
+
+/* don't include non-standard header files */
 #define SCAN_DEPEND
 
 
@@ -23,6 +25,8 @@
 /* Make OpenGL mandatory. A library without OpenGL lacks many
  * exports specific to OpenGL, which makes it ABI incompatible. */
 #define ALLEGRO_CFG_OPENGL
+/* Make D3D mandatory. */
+#define ALLEGRO_CFG_D3D
 
 
 #if defined ALLEGRO_API






Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/