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

2016-07-14 Thread Brady Eidson

> On Jul 14, 2016, at 11:17 AM, Frédéric WANG  wrote:
> 
> FYI, I just performed that change as part of a general cleanup of MathML
> headers:
> 
> https://trac.webkit.org/changeset/203228
> 
> The code style guidelines still mention the old-style header guards so
> it should probably be updated:
> 
> https://webkit.org/code-style-guidelines/#names-header-guards 
> 

Header guard style should be updated to be "#pragma once"
https://bugs.webkit.org/show_bug.cgi?id=159785 


~Brady

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


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

2016-07-14 Thread Frédéric WANG
FYI, I just performed that change as part of a general cleanup of MathML
headers:

https://trac.webkit.org/changeset/203228

The code style guidelines still mention the old-style header guards so
it should probably be updated:

https://webkit.org/code-style-guidelines/#names-header-guards

Le 10/03/2016 à 02:27, Anders Carlsson a écrit :
> 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@lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev




signature.asc
Description: OpenPGP digital signature
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


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

2016-03-19 Thread Darin Adler
> On Mar 17, 2016, at 9:35 AM, Konstantin Tokarev  wrote:
> 
> Here is a script which apparently can be used to convert whole code base to 
> new style:
> 
> https://github.com/cgmb/guardonce

They sound like they are worth trying. Especially the “checkguard” script.

Whoever runs the script needs to be sure not to land any changes to API headers 
or third party source code.

— Darin
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


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

2016-03-19 Thread Konstantin Tokarev


10.03.2016, 05:07, "Brent Fulgham" :
>>  On Mar 9, 2016, at 5:27 PM, Anders Carlsson  wrote:
>>
>>  I propose that we instead start using
>>
>>  #pragma once
>
> +1

Here is a script which apparently can be used to convert whole code base to new 
style:

https://github.com/cgmb/guardonce

-- 
Regards,
Konstantin
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


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

2016-03-09 Thread Anders Carlsson
Yeah, I agree.

- Anders

> On Mar 9, 2016, at 6:46 PM, Michael Catanzaro  wrote:
> 
> On Wed, 2016-03-09 at 17:27 -0800, Anders Carlsson 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.
> 
> I think it's fine for the GTK port in general, but it would be nice to
> keep this out of our public headers. That is mostly just GTK-specific
> headers, but also the public JavaScriptCore headers JavaScript.h,
> JSBase.h, JSContextRef.h, JSObjectRef.h, JSStringRef.h, JSValueRef.h,
> and WebKitAvailability.h.
> 
> Michael

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


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

2016-03-09 Thread Michael Catanzaro
On Wed, 2016-03-09 at 17:27 -0800, Anders Carlsson 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.

I think it's fine for the GTK port in general, but it would be nice to
keep this out of our public headers. That is mostly just GTK-specific
headers, but also the public JavaScriptCore headers JavaScript.h,
JSBase.h, JSContextRef.h, JSObjectRef.h, JSStringRef.h, JSValueRef.h,
and WebKitAvailability.h.

Michael
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


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

2016-03-09 Thread Brent Fulgham

> On Mar 9, 2016, at 5:27 PM, Anders Carlsson  wrote:
> 
> I propose that we instead start using
> 
> #pragma once

+1
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


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

2016-03-09 Thread Anders Carlsson
I think we should put it where we currently have the header guard. I think the 
pragma is easier to understand than a #ifndef/#define.

- Anders

> On Mar 9, 2016, at 5:33 PM, Brian Burg  wrote:
> 
> 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  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@lists.webkit.org
>> https://lists.webkit.org/mailman/listinfo/webkit-dev
> 

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


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

2016-03-09 Thread Brian Burg
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  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@lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


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

2016-03-09 Thread Anders Carlsson
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@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev