[webkit-dev] Proposal: Use #pragma once instead of header guards

Brian Burg bburg at apple.com
Wed Mar 9 17:33:03 PST 2016


Cool! It sounds like something good for new headers and drive-by cleanups, to start.
To clarify, it would always go after the license block? Is the pragma name stable and understandable enough to paste everywhere?

	-Brian

> On Mar 9, 2016, at 17:27, Anders Carlsson <andersca at apple.com> wrote:
> 
> Hi floks,
> 
> Currently we use 
> 
> #ifndef Header_h
> #define Header_h
> 
>> 
> #endif
> 
> I propose that we instead start using
> 
> #pragma once
> 
> which does the same thing. It can be faster on some compilers, is less error prone and is one line instead of three! All compilers we use support #pragma once.
> 
> Thoughts?
> - Anders
> 
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev



More information about the webkit-dev mailing list