[Top][All Lists]

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

cmacexp.el with NT Emacs and MSVC++

From: Andrew Bolt
Subject: cmacexp.el with NT Emacs and MSVC++
Date: Fri, 31 Aug 2001 18:10:06 +0100
User-agent: Mutt/1.2.3i

I've been having problems getting C macro expansion working under
NT Emacs (20.7.1) with Microsoft VisualC++'s 'CL.EXE' compiler.

CL doesn't seem to like accepting input on stdin, so I wrote a
batch file called 'C:\GNU\CPP.BAT' that does:
  cat > c:\temp\prepro.tmp
  cl /nologo /C /E c:\temp\prepro.tmp %*
(using cat from MKS because DOS doesn't seem to have a working

I've set Emacs to invoke the preprocessor as 'C:\GNU\CPP.BAT',
and that almost works.  The only problem is that errors aren't
handled correctly: if the preprocessor hits an error before the 
'??? !!! ???' marker, the '(search-forward startmarker)' command
fails, and aborts the processing.

I've changed those lines to:
   (if (search-forward startmarker nil t) ;; don't stop on errors
       (delete-region 1 (point))))
so that if the startmarker isn't found, you get to see the output
of the preprocessor rather than an error code.

Finally, the Emacs always gets an errorcode of zero, so I
assume I should set msdos-shells to 'cmdproxy.exe' to tell the
code to ignore the return code.  This doesn't seem to be
Andrew Bolt, Andrew.Bolt@arm.com
110 Fulbourn Road, Cambridge, CB1 9NJ, ENGLAND, +44 1223 400650

reply via email to

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