On 4/23/05, Ron Blaschke <[EMAIL PROTECTED]> wrote:
> 1) F<pge_gen.c> uses C<vsnprintf>, which is named C<_vsnprintf> on
> MSWin32.  A simple hack would be to add the following to F<pge_gen.c>.
> 
>    #ifdef WIN32
>    #  define vsnprintf _vsnprintf
>    #endif

confirmed here on VS.NET 2003 (aka MSVC 7.1), although this is not
necessary for VS.NET 2005 as vsnprintf is defined there. however, i
suggest this hack is added to pge.h instead.

Index: compilers/pge/pge.h
===================================================================
--- compilers/pge/pge.h (revision 7925)
+++ compilers/pge/pge.h (working copy)
@@ -8,6 +8,10 @@
#define PGE_INF INT_MAX
#define PGE_MAX_LITERAL_LEN 128

+#ifdef _WIN32
+    #define vsnprintf _vsnprintf
+#endif
+
typedef enum {
     PGE_NULL_PATTERN,
     PGE_PATTERN_END, PGE_DOT, PGE_LITERAL,


> 2) Linkage for F<pge.dll> should read something like this.
> 
>    link -dll -nologo -nodefaultlib -out:pge.dll pge_parse.obj
>    pge_gen.obj pge_opt.obj pge_parsep5.obj pge_parseglob.obj
>    msvcrt.lib kernel32.lib
> 
> IMHO, compilation and linkage feels quite messy as a whole.  I am not
> sure how to get the current link command to look like the one above,
> without doing something akin to F<dynclasses/build.pl>
> (cf line 40+).

totally agree. it's a mess to fix. modifying
config/gen/makefiles/pge.in at least gets the command syntax right:

Index: config/gen/makefiles/pge.in
===================================================================
--- config/gen/makefiles/pge.in (revision 7925)
+++ config/gen/makefiles/pge.in (working copy)
@@ -37,7 +37,7 @@
        $(CP) pge$(SO) $(PARROT_RUNTIME)

 pge$(SO): pge_parse$(O) pge_gen$(O) pge_opt$(O) pge_parsep5$(O)
pge_parseglob$(O)
-       $(LD) $(LD_SHARE_FLAGS) $(LDFLAGS) -o pge$(SO) pge_parse$(O)
pge_gen$(O) pge_opt$(O) pge_parsep5$(O) pge_parseglob$(O)
+       $(LD) $(LD_SHARE_FLAGS) $(LDFLAGS) ${ld_out}pge$(SO)
pge_parse$(O) pge_gen$(O) pge_opt$(O) pge_parsep5$(O)
pge_parseglob$(O)

 pge_gen$(O): pge_gen.c pge.h
 pge_parse$(O): pge_parse.c pge.h

... but since $(LD_SHARE_FLAGS) has -def:libparrot.def hardcoded, it's
troublesome as it breaks the linker when building pge.dll. i'm working
on it, but it's slow going.

> Ron
~jerry

Reply via email to