From 4f88655a79bb2d8f10bdce2841f427c0e27040bd Mon Sep 17 00:00:00 2001 From: shinny Date: Tue, 2 Jun 2020 14:51:57 -0400 Subject: update tools --- tools/preproc/Makefile | 7 +++++-- tools/preproc/asm_file.cpp | 7 +++++-- tools/preproc/c_file.cpp | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'tools/preproc') diff --git a/tools/preproc/Makefile b/tools/preproc/Makefile index 3d32758..8c48afe 100644 --- a/tools/preproc/Makefile +++ b/tools/preproc/Makefile @@ -1,4 +1,4 @@ -CXX := g++ +CXX ?= g++ CXXFLAGS := -std=c++11 -O2 -Wall -Wno-switch -Werror @@ -8,7 +8,10 @@ SRCS := asm_file.cpp c_file.cpp charmap.cpp preproc.cpp string_parser.cpp \ HEADERS := asm_file.h c_file.h char_util.h charmap.h preproc.h string_parser.h \ utf8.h -.PHONY: clean +.PHONY: all clean + +all: preproc + @: preproc: $(SRCS) $(HEADERS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) diff --git a/tools/preproc/asm_file.cpp b/tools/preproc/asm_file.cpp index 383010a..7756cad 100644 --- a/tools/preproc/asm_file.cpp +++ b/tools/preproc/asm_file.cpp @@ -20,6 +20,7 @@ #include #include +#include #include "preproc.h" #include "asm_file.h" #include "char_util.h" @@ -475,9 +476,11 @@ void AsmFile::ExpectEmptyRestOfLine() m_lineStart = m_pos; m_lineNum++; } - else if (m_buffer[m_pos] == '\r') + else if (m_buffer[m_pos] == '\r' && m_buffer[m_pos + 1] == '\n') { - RaiseError("only Unix-style LF newlines are supported"); + m_pos += 2; + m_lineStart = m_pos; + m_lineNum++; } else { diff --git a/tools/preproc/c_file.cpp b/tools/preproc/c_file.cpp index 229f568..b996a04 100644 --- a/tools/preproc/c_file.cpp +++ b/tools/preproc/c_file.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include #include "preproc.h" -- cgit v1.2.3