On Tue, 11 Nov 2008 14:26:39 +1100, "Lex Trotman" elextr@gmail.com wrote:
Hey,
The point of all this is that providing support for the C++ .h files is important, so correctly detecting them is important. So is compiling .h files independently, it is annoying having to pick through errors in the .cpp file (often caused by errors in the .h file) to find the .h errors and fix them first, usually it gets so
As Nick already said, this is a build command issue. With the current code, one solution could be to remove the limitation that headers files can't be compiled. I don't remember exactly why I added this but mainly because until this thread I was thinking compiling header files doesn't make any sense at all. Maybe there were other reasons, too. Anyway, there should be really no need for separate header filetypes. And since you are currently about to rework the build system, just make the custom filetype build commands work with header files.
The marking -*-C++-*- exists on all GNU headers which means it should be present on most Linuxii, I don't know about windows though. Looking at other (non-system) library headers I've got available, most of the C++ .h files identify themselves and interestingly about 15% of the C .h files identify themselves as C. In terms of the delays in opening the file, it is only intended to look at line 1 which has already been examined for shebang so it is already available in memory, most of the overhead has already occurred. Having separate C+
Yup, this is why I said the check should work on the first line or the first both lines. Then it doesn't cause much more overhead than already existent.
- header templates with the mark already in it would help users to
remember to add it. BTW it would be good to have these separate .h .hpp templates irrespective of the end result of these discussions because creating headers using C or C++ templates and filenames means you need to delete the main you don't want, add the guards etc.and then change the file extension on save too.
Check the classbuilder plugin. It's not exactly the same but it creates C++ class files and the corresponding headers, including guards and all this stuff. Unfortunately, the used templates in the plugin are not (yet) configurable but this is an easy task, it just needs to be done. Alternatively, Nick already stated about custom file templates.
Regards, Enrico