Mark Salyzyn | be1d3c2 | 2016-03-10 08:25:33 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef _LIBLOG_CDEFS_H__ |
| 18 | #define _LIBLOG_CDEFS_H__ |
| 19 | |
| 20 | #include <sys/cdefs.h> |
| 21 | |
| 22 | /* Declare this library function hidden and internal */ |
| 23 | #if defined(_WIN32) |
| 24 | #define LIBLOG_HIDDEN |
| 25 | #else |
| 26 | #define LIBLOG_HIDDEN __attribute__((visibility("hidden"))) |
| 27 | #endif |
| 28 | |
| 29 | /* Declare this library function visible and external */ |
| 30 | #if defined(_WIN32) |
| 31 | #define LIBLOG_ABI_PUBLIC |
| 32 | #else |
| 33 | #define LIBLOG_ABI_PUBLIC __attribute__((visibility("default"))) |
| 34 | #endif |
| 35 | |
| 36 | /* Declare this library function visible but private */ |
| 37 | #define LIBLOG_ABI_PRIVATE LIBLOG_ABI_PUBLIC |
| 38 | |
| 39 | /* |
| 40 | * Declare this library function as reimplementation. |
| 41 | * Prevent circular dependencies, but allow _real_ library to hijack |
| 42 | */ |
| 43 | #if defined(_WIN32) |
| 44 | #define LIBLOG_WEAK static /* Accept that it is totally private */ |
| 45 | #else |
| 46 | #define LIBLOG_WEAK __attribute__((weak,visibility("default"))) |
| 47 | #endif |
| 48 | |
| 49 | /* Unused argument. For C code only, remove symbol name for C++ */ |
| 50 | #ifndef __unused |
| 51 | #define __unused __attribute__((__unused__)) |
| 52 | #endif |
| 53 | |
| 54 | #endif /* _LIBLOG_CDEFS_H__ */ |