Closed GoogleCodeExporter closed 8 years ago
What actually happens with the Sun compiler? Does it compile incorrectly? Does
it list a bunch of warnings?
There's an include guard as well, so if it doesn't know what to do with "pragma
once", it should just ignore it, and the include guard would take over, I think.
The reason the #if statement is there for gcc is that old versions of gcc gave
a bunch of warnings about it:
http://code.google.com/p/yaml-cpp/issues/detail?id=91
Original comment by jbe...@gmail.com
on 22 Aug 2011 at 9:43
The Sun compiler warns about "unknown pragma" which is pretty typical.
So, the reason to modify the macro that protects the pragma is the same as for
gcc, and generally it's a good idea to only add a very helpful pragma when you
have verified that it is supported.
I don't know of any compilers other than GCC and MS Visual C++ that have this,
but I would guess there are some... Poking around the web I don't see any C++
compilers other than these though.
IMHO, this is about as good as you can get, use pragma once where you *know*
it's supported, and also have regular old include guards for systems where it's
not.
Original comment by rboe...@gmail.com
on 25 Aug 2011 at 5:38
Fixed, r292:fa9911436ac6. Thanks!
Original comment by jbe...@gmail.com
on 6 Sep 2011 at 5:16
Original issue reported on code.google.com by
rboe...@gmail.com
on 22 Aug 2011 at 9:36