ned14 / pcpp

A C99 preprocessor written in pure Python
Other
215 stars 39 forks source link

Prepend "#pragma once" on the generated header #33

Closed fondesa closed 4 years ago

fondesa commented 4 years ago

Python version: 3.7.4 pcpp version: 1.21

 Description

If the headers in input have guards or #pragma once, I expected the output to contain #pragma once at the top.

Example

first.hpp

#pragma once 

namespace First {}

second.hpp

#pragma once 

namespace Second {}

Command

pcpp first.hpp second.hpp

Actual output

#line 3 "first.hpp"
namespace First {}
#line 3 "second.hpp"
namespace Second {}

Expected output

#pragma once
#line 3 "first.hpp"
namespace First {}
#line 3 "second.hpp"
namespace Second {}
ned14 commented 4 years ago

If you've told pcpp to not pass through, it'll execute the preprocessor commands and remove them from the output.

ned14 commented 4 years ago

Closing due to inactivity