WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
17807
CSSPropertyNames.h is included in a .c file, but uses C++ features
https://bugs.webkit.org/show_bug.cgi?id=17807
Summary
CSSPropertyNames.h is included in a .c file, but uses C++ features
Mark Mentovai
Reported
2008-03-12 14:16:05 PDT
CSSPropertyNames.h, built by WebCore/css/makeprop.pl, should be generated as C source. makeprop.pl also generates CSSPropertyNames.c, which includes CSSPropertyNames.h, and the use of a C++ism in CSSPropertyNames.h will cause compilation to fail if the .c file is, as its extension implies, built as straight C source. The problem is that the generated CSSPropertyNames.h file uses "enum CSSPropertyID", but CSSPropertyNames.c references it as "CSSPropertyID" without the enum. In C++, this is valid, but in C, it is not valid without a typedef. Using a typedef in the .h file would allow the enum to be accessed consistently by C and C++ source. Alternatively, the .c file should be changed to reference CSSPropertyID as "enum CSSPropertyID".
Attachments
Use "typedef enum" in makeprop.pl, which generates CSSPropertyNames.{h,c}
(1.04 KB, patch)
2008-03-12 14:18 PDT
,
Mark Mentovai
darin
: review-
Details
Formatted Diff
Diff
Move CSSPropertyNames.c to CSSPropertyNames.cpp
(3.83 KB, patch)
2008-03-12 14:49 PDT
,
Mark Mentovai
eric
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Mark Mentovai
Comment 1
2008-03-12 14:18:40 PDT
Created
attachment 19711
[details]
Use "typedef enum" in makeprop.pl, which generates CSSPropertyNames.{h,c}
Darin Adler
Comment 2
2008-03-12 14:24:55 PDT
Comment on
attachment 19711
[details]
Use "typedef enum" in makeprop.pl, which generates CSSPropertyNames.{h,c} This patch isn't really a good idea. Instead the generated file should be changed to CSSPropertyNames.cpp. We have no reason to use C instead of C++ for part of WebKit.
Mark Mentovai
Comment 3
2008-03-12 14:49:56 PDT
Created
attachment 19716
[details]
Move CSSPropertyNames.c to CSSPropertyNames.cpp
Eric Seidel (no email)
Comment 4
2008-03-12 15:09:33 PDT
Comment on
attachment 19716
[details]
Move CSSPropertyNames.c to CSSPropertyNames.cpp Looks good to me. r=me. I would leave this to Darin as he commented originally, but this patch is simple enough I feel I can just r+ anyway. I don't see why it matters what the extension is though, since it's just included in another .cpp file.
Eric Seidel (no email)
Comment 5
2008-03-13 20:45:45 PDT
Thank you mark for making such easy-to-land patches. These took only a few minutes to land on my train ride home. :) These are revisions
r31048
through
r31053
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug