1 /* 2 * Copyright 2014, 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 _PORTABILITY_H_ 18 #define _PORTABILITY_H_ 19 20 /* 21 * Hidden functions are exposed while linking the libportable shared object 22 * but are not exposed thereafter. 23 */ 24 #define __hidden __attribute__((visibility("hidden"))) 25 26 #if !defined(__HOST__) 27 #define WRAP(f) f ## _portable 28 #define REAL(f) f 29 #else 30 /* On host app link with libpportable.a with -Wl,--wrap=symbol, which resolves undefined symbol to __wrap_symbol, 31 * and undefined __real_symbol to the original symbol 32 */ 33 #define WRAP(f) __wrap_ ## f 34 #define REAL(f) __real_ ## f 35 #endif 36 37 38 #endif /* _PORTABILITY_H_ */ 39