bug-gnu-emacs
[Top][All Lists]
Advanced

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

Problems Building Emacs-21.3 or Later with Mingw Runtime 3.2


From: Harald Maier
Subject: Problems Building Emacs-21.3 or Later with Mingw Runtime 3.2
Date: Thu, 26 Feb 2004 10:45:59 +0100
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

Just for your info, I submit the following bug report (904946) to the
mingw maintainer at http://sourceforge.net.

Harald

I found two stdio.h issue during building NT emacs-21.3 or later with
the actual mingw runtime.

OS-Version is Windows 2000.

I am using the following packages:

  - binutils-2.15.90-20040222-1.tar.gz  
  - mingw-runtime-3.2.tar.gz
  - gcc-core-3.3.1-20030804-1.tar.gz    
  - w32api-2.5.tar.gz

1. The following line at 388 in the stdio.h file

,----
| _CRTIMP int __cdecl   fileno (FILE*);
`----

causes the following compilation error:

,----
| gcc -I. -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0400 -D_X86_=1 -c -g  
-mcpu=i686
| -O2  -Di386 -D_CRTAPI1=_cdecl   -Demacs=1 -DWINDOWSNT -DDOS_NT 
-DHAVE_CONFIG_H -
| I../nt/inc -D_UCHAR_T -DHAVE_NTGUI=1 -DUSE_CRT_DLL=1 -o oo-spd/i386/lread.o 
lrea
| d.c
| In file included from s/ms-w32.h:394,
|                  from config.h:281,
|                  from lread.c:23:
| d:/usr/mingw-new/include/stdio.h:388: error: parse error before '*' token
| make.exe[1]: *** [oo-spd/i386/lread.o] Error 1
| make.exe[1]: Leaving directory `g:/cvs/emacs-cygwin/src'
`----

If I set the line 388 in comments then all works fine.

2. In the -O2 mode dumping emacs fails to due the inline getc
   function in the stdio.h file.

During the emacs build process a bare emacs (temacs.exe) dumps itself
into the emacs.exe. During this phase emacs reads the byte compiled
lisp file into memory. By some of the byte compiled lisp files emacs
receives a end of file assertion because the inline 'getc' function of
the stdio.h file returns a character that is less zero. If I set the
function 'getc' in the stdio.h file into comments, so that the library
'getc' function is used, then all works fine.

Here the patched stdio.h file with that building emacs works:

*** stdio.h.orig        Fri Oct 10 17:24:32 2003
--- stdio.h     Thu Feb 26 10:00:12 2004
***************
*** 262,273 ****
  
  #if !defined _MT
  
! __CRT_INLINE int __cdecl getc (FILE* __F)
! {
!   return (--__F->_cnt >= 0)
!     ?  (int) *__F->_ptr++
!     : _filbuf (__F);
! }
  
  __CRT_INLINE int __cdecl putc (int __c, FILE* __F)
  {
--- 262,273 ----
  
  #if !defined _MT
  
! /* __CRT_INLINE int __cdecl getc (FILE* __F) */
! /* { */
! /*   return (--__F->_cnt >= 0) */
! /*     ?  (int) *__F->_ptr++ */
! /*     : _filbuf (__F); */
! /* } */
  
  __CRT_INLINE int __cdecl putc (int __c, FILE* __F)
  {
***************
*** 385,391 ****
  _CRTIMP int __cdecl   fgetchar (void);
  _CRTIMP int __cdecl   fputchar (int);
  _CRTIMP FILE* __cdecl fdopen (int, const char*);
! _CRTIMP int __cdecl   fileno (FILE*);
  
  #define fileno(__F) ((__F)->_file)
  
--- 385,391 ----
  _CRTIMP int __cdecl   fgetchar (void);
  _CRTIMP int __cdecl   fputchar (int);
  _CRTIMP FILE* __cdecl fdopen (int, const char*);
!   //_CRTIMP int __cdecl       fileno (FILE*);
  
  #define fileno(__F) ((__F)->_file)
  


reply via email to

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