1/*
2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
3 * Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
18 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
24 * THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#ifndef WKDeclarationSpecifiers_h
28#define WKDeclarationSpecifiers_h
29
30#ifndef __has_declspec_attribute
31#define __has_declspec_attribute(x) 0
32#endif
33
34#undef WK_EXPORT
35#if defined(WK_NO_EXPORT)
36#define WK_EXPORT
37#elif defined(WIN32) || defined(_WIN32) || defined(__CC_ARM) || defined(__ARMCC__) || (__has_declspec_attribute(dllimport) && __has_declspec_attribute(dllexport))
38#if BUILDING_WebKit
39#define WK_EXPORT __declspec(dllexport)
40#else
41#define WK_EXPORT __declspec(dllimport)
42#endif /* BUILDING_WebKit */
43#elif defined(__GNUC__)
44#define WK_EXPORT __attribute__((visibility("default")))
45#else /* !defined(WK_NO_EXPORT) */
46#define WK_EXPORT
47#endif /* defined(WK_NO_EXPORT) */
48
49#if !defined(WK_INLINE)
50#if defined(__cplusplus)
51#define WK_INLINE static inline
52#elif defined(__GNUC__)
53#define WK_INLINE static __inline__
54#else
55#define WK_INLINE static
56#endif
57#endif /* !defined(WK_INLINE) */
58
59#ifndef __has_extension
60#define __has_extension(x) 0
61#endif
62
63#if __has_extension(enumerator_attributes) && __has_extension(attribute_unavailable_with_message)
64#define WK_C_DEPRECATED(message) __attribute__((deprecated(message)))
65#else
66#define WK_C_DEPRECATED(message)
67#endif
68
69#ifndef __has_attribute
70#define __has_attribute(x) 0
71#endif
72
73#if __has_attribute(unavailable)
74#define WK_UNAVAILABLE __attribute__((unavailable))
75#else
76#define WK_UNAVAILABLE
77#endif
78
79#endif /* WKDeclarationSpecifiers_h */
80