| OLD | NEW |
| (Empty) | |
| 1 /* |
| 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. |
| 5 */ |
| 6 |
| 7 #ifndef NATIVE_CLIENT_SRC_INCLUDE_NACL_COMPILER_ANNOTATIONS_H_ |
| 8 #define NATIVE_CLIENT_SRC_INCLUDE_NACL_COMPILER_ANNOTATIONS_H_ |
| 9 |
| 10 /* MSVC supports "inline" only in C++ */ |
| 11 #if NACL_WINDOWS |
| 12 # define INLINE __forceinline |
| 13 #else |
| 14 # define INLINE __inline__ |
| 15 #endif |
| 16 |
| 17 #if NACL_WINDOWS |
| 18 # define DLLEXPORT __declspec(dllexport) |
| 19 #elif defined(NACL_LINUX) || defined(NACL_OSX) |
| 20 # define DLLEXPORT __attribute__ ((visibility("default"))) |
| 21 #elif defined(__native_client__) |
| 22 /* do nothing */ |
| 23 #else |
| 24 # error "what platform?" |
| 25 #endif |
| 26 |
| 27 #if NACL_WINDOWS |
| 28 # define ATTRIBUTE_FORMAT_PRINTF(m, n) |
| 29 #else |
| 30 # define ATTRIBUTE_FORMAT_PRINTF(m, n) __attribute__((format(printf, m, n))) |
| 31 #endif |
| 32 |
| 33 #if NACL_WINDOWS |
| 34 # define UNREFERENCED_PARAMETER(P) (P) |
| 35 #else |
| 36 # define UNREFERENCED_PARAMETER(P) do { (void) P; } while (0) |
| 37 #endif |
| 38 |
| 39 #if NACL_WINDOWS |
| 40 # define NORETURN __declspec(noreturn) |
| 41 #else |
| 42 # define NORETURN __attribute__((noreturn)) /* assumes gcc */ |
| 43 # define _cdecl /* empty */ |
| 44 #endif |
| 45 |
| 46 #if NACL_WINDOWS |
| 47 # define THREAD __declspec(thread) |
| 48 #else |
| 49 # define THREAD __thread |
| 50 # define WINAPI |
| 51 #endif |
| 52 |
| 53 #if NACL_WINDOWS |
| 54 # define NACL_WUR |
| 55 #else |
| 56 # define NACL_WUR __attribute__((__warn_unused_result__)) |
| 57 #endif |
| 58 |
| 59 #endif |
| OLD | NEW |