bug-bison
[Top][All Lists]
Advanced

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

Re: Bison 1.35 is compiled for Win32 with MSVC 6.0


From: Yury Lebedev
Subject: Re: Bison 1.35 is compiled for Win32 with MSVC 6.0
Date: Thu, 26 Sep 2002 09:57:25 +0400

To addition:
Possible it's better to use _MSC_VER macro instead of _WIN32 in my path of
src/main.c to apply the fix only for pure MSVC build (with *NO* any CYGWIN
libraries usage). Compiled bison.exe doesn't require any CYGWIN packages
installed, it needs only for bison.simple and bison.hairy datafiles located in
same directory where it should be launched. It will be pure standalone
application.

Regards, Yury Lebedev

*** main.c.orig Tue Dec 18 07:53:36 2001
--- main.c Thu Sep 26 05:42:58 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 _MSC_VER
+ /* 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 /* _MSC_VER */

  int
  main (int argc, char *argv[])
  {
    program_name = argv[0];
+
+ #ifdef _MSC_VER
+   if (GetModuleFileName (0, program_name_buf, sizeof(program_name_buf)) > 0)
+     program_name = program_name_buf;
+ #endif /* _MSC_VER */
+
    setlocale (LC_ALL, "");
    bindtextdomain (PACKAGE, LOCALEDIR);
    textdomain (PACKAGE);







reply via email to

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