bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bison 1.35 is complied for Win32 with MSVC 6.0


From: Akim Demaille
Subject: Re: Bison 1.35 is complied for Win32 with MSVC 6.0
Date: 26 Sep 2002 13:08:34 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

| Hello all Bison users

Hi!

| Here is a patch to compile Bison v1.35 for Win32 platforms and use it as
| standalone application. Latest Bison already searches for bison.simple and
| bison.hairy datafiles in bison.exe startup directory and can be conveniently
| used separately but nevertheless some small fixes are required.

Sorry, but I will not install your patches, because they are way too
much much `Windows' oriented.  You submit more configure.ac things,
more replacement functions etc.  but not to add `#if MY_FAVORITE_ARCH'
patches.

Nevertheless, you are of course most welcome to distribute
pre-compiled version of Bison.



| *** main.c.orig Tue Dec 18 07:53:36 2001
| --- main.c Fri Sep 20 06:32:04 2002
| ***************
| *** 37,50 ****
|   #include "symtab.h"
|   #include "lex.h"
| 
| ! /* The name this program was run with, for messages.  */
|   char *program_name;
| 
| 
|   int
|   main (int argc, char *argv[])
|   {
|     program_name = argv[0];
|     setlocale (LC_ALL, "");
|     bindtextdomain (PACKAGE, LOCALEDIR);
|     textdomain (PACKAGE);
| --- 37,62 ----
|   #include "symtab.h"
|   #include "lex.h"
| 
| ! /* The name this program was run with, for messages and datafiles
| searching.  */
|   char *program_name;
| 
| + #ifdef _WIN32
| + /* Program name buffer to store real full filename via GetModuleFileName()
| call. */
| + # define WIN32_LEAN_AND_MEAN 1
| + # include <windows.h>
| + char program_name_buf[1024];
| + #endif /* _WIN32 */
| 
|   int
|   main (int argc, char *argv[])
|   {
|     program_name = argv[0];
| +
| + #ifdef _WIN32
| +   if (GetModuleFileName (0, program_name_buf, sizeof(program_name_buf)) >
| 0)
| +     program_name = program_name_buf;
| + #endif




| +
|     setlocale (LC_ALL, "");
|     bindtextdomain (PACKAGE, LOCALEDIR);
|     textdomain (PACKAGE);
| ***************
| Also output.c was patched to replace alloca() call with malloc() one - MSVC
| provides its own alloca() implementation but I could not find its definition
| in libc.lib and other libraries! :(
| *** output.c.orig Mon Mar 04 16:48:38 2002
| --- output.c Fri Sep 20 06:23:56 2002
| ***************
| *** 354,366 ****
| --- 354,373 ----
|   output_stos (void)
|   {
|     int i;
| + #if HAVE_ALLOCA || C_ALLOCA
|     short *values = (short *) alloca (sizeof (short) * nstates);
| + #else
| +   short *values = XMALLOC (short, nstates);
| + #endif

I don't understand, this ought to be taken care of by configure.  What
is the problem?


| Short README about this also attached.

This is great work!  I'm ready to put instruction into a new
directory, say arch/win32, but not in sources of Bison itself.  Sorry :(




reply via email to

[Prev in Thread] Current Thread [Next in Thread]