
10 Jun
2009
10 Jun
'09
2:58 a.m.
2009/6/9 Christopher Jefferson <chris@bubblescope.net>:
One thing to watch out for, in case you don't notice in advance: Some headers should NOT have #pragma once. Not very many, but such files exist. You'll probably want to try to find some way of guessing if a file already has a standard include guard (shouldn't be too hard to detect), and only #pragma once such files.
Which is exactly what GCC does to not need #pragma once =) (And that check can be made fast by allowing the pathological cases to fall back to the normal include guard behaviour, as that's still safe, whereas #pragma once always has to go the slow route of canonizing all the paths -- which isn't even always possible -- to be safe.) ~ Scott