Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Missing #endif in pure cpp1 header file when generated using -import-std #1320

Open
MatthieuHernandez opened this issue Oct 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@MatthieuHernandez
Copy link
Contributor

I've noticed that if I execute cppfront.exe with the -import-std option on a .h file that doesn't contain any cpp2 code, then an #endif will be missing at the end of the file.

This file:
color.h2

enum Color: uint8_t {
    None = 0,
    Black = 1,
    White = 2,
};

With the command below:

cppfront -cwd ./generate ../src/color.h2 -import-std

Gerenates the following cpp1 code with a missing #endif:

#ifndef COLOR_H_CPP2
#define COLOR_H_CPP2

#define CPP2_IMPORT_STD          Yes

#include "cpp2util.h"

enum Color: uint8_t {
    None = 0,
    Black = 1,
    White = 2,
};

@JohelEGP I think the PR #1319 fixes exactly this bug.
Do you see a cleaner way to fix this bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant