Changeset 95823 in webkit


Ignore:
Timestamp:
Sep 23, 2011, 9:49:08 AM (14 years ago)
Author:
andersca@apple.com
Message:

We should add support for OVERRIDE and FINAL annotations
https://bugs.webkit.org/show_bug.cgi?id=68654

Reviewed by David Hyatt.

Add OVERRIDE and FINAL macros for compilers that support them.

  • wtf/Compiler.h:
Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r95787 r95823  
     12011-09-22  Anders Carlsson  <andersca@apple.com>
     2
     3        We should add support for OVERRIDE and FINAL annotations
     4        https://bugs.webkit.org/show_bug.cgi?id=68654
     5
     6        Reviewed by David Hyatt.
     7
     8        Add OVERRIDE and FINAL macros for compilers that support them.
     9
     10        * wtf/Compiler.h:
     11
    1122011-09-22  Filip Pizlo  <fpizlo@apple.com>
    213
  • trunk/Source/JavaScriptCore/wtf/Compiler.h

    r93012 r95823  
    3535#if defined(__clang__)
    3636#define WTF_COMPILER_CLANG 1
     37
     38#ifndef __has_extension
     39#define __has_extension __has_feature /* Compatibility with older versions of clang */
     40#endif
     41
    3742#endif
    3843
     
    190195#endif
    191196
     197/* OVERRIDE */
     198
     199#ifndef OVERRIDE
     200#if COMPILER(CLANG)
     201#if __has_extension(cxx_override_control)
     202#define OVERRIDE override
     203#endif
     204#elif COMPILER(MSVC)
     205#define OVERRIDE override
     206#else
     207#define OVERRIDE
     208#endif
     209#endif
     210
     211/* FINAL */
     212
     213#ifndef FINAL
     214#if COMPILER(CLANG)
     215#if __has_extension(cxx_override_control)
     216#define FINAL final
     217#endif
     218#elif COMPILER(MSVC)
     219#define FINAL sealed
     220#else
     221#define FINAL
     222#endif
     223#endif
    192224
    193225#endif /* WTF_Compiler_h */
Note: See TracChangeset for help on using the changeset viewer.