Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Gametee

Post Reply 
Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Supporting #Include (And Other C Preprocessor Directives)
Author Message
Apjjm Offline
Is easy to say

Posts: 495
Joined: Apr 2011
Reputation: 51
Post: #11
RE: Supporting #Include (And Other C Preprocessor Directives)

There is a bug in the preprocessor (source) with the -C (comments) flag, this will cause single lines with comments on the end to be deleted / commented out. The fix is simply to remove the switch from the batch file if you have already downloaded it. I am uploading a fixed version now too. This means comments won't be in the output file (but this shouldn't be an issue, as you will be editing files with comments in just fine).

Fixed batch script:
::Batch file to aid HPS preprocessing - Apjjm.
::%1 - Directory of file to pre-process (and where output should go)
::%2 - Name of file to pre-process
::%3 - Name of file to output (the pre-processed file)

::PATH TO MCPP. You probably won't need to change this.
SET MCPP="%~DP0\mcpp-2.7.2-bin\mcpp-2.7.2\bin\mcpp.exe"

SET ERRF="errors.txt"

cD "%1"
%MCPP% "%2" "%3" -P -W0 2> %ERRF%
CALL :ShowErrors %ERRF%
goto :eof

              ECHO ====================================
                      TYPE %1
                      PAUSE )
goto :eof

Edit: First post updated with new link.

(This post was last modified: 05-07-2012 02:46 AM by Apjjm.)
05-07-2012 02:43 AM
Find all posts by this user Quote this message in a reply
Post Reply 

Messages In This Thread
RE: Supporting #Include (And Other C Preprocessor Directives) - Apjjm - 05-07-2012 02:43 AM

User(s) browsing this thread: 1 Guest(s)