@:headerCode does not appear to work?

As listed here I’ve been attempting to inject inline c++.

@:functionCode and @:functionTailCode appear to work fine.

Unfortunately I can’t find any way of inserting code in to the head of files.

@:headerCode and @:cppFileCode both appear to be non-functional with the current version of haxe and hxcpp (examining the generated C++ files shows nothing added).

Is there an alternative way of injecting C++ in to the head of files? is this a bug or was it deliberately removed? :confused:

Thanks xx

I think traditionally, you would use @:headerCode with an #include, is that how you are doing it?

Yeah (although I’m trying to inject some preprocessor etc checks too). It’s not being echo’d out in the cpp source file, though :confused:

What about the C++ header file? There should be a header and source file for each

Forgot what I said. Obviously user error >.>

@:headerCode and @cppFileCode only work when used directly above class definitions. Not enums, typedefs or anything else; as each class is obviously compiled to a separate file. Putting them anywhere else in the file they will be silently ignored because they are class macros.

My brain totally neglected to notice this. Sorry.

Hey, this is good to know, though. Every post here becomes a form of documentation… I’m not sure this was immediately clear