/* * Copyright 2010, The Android Open Source Project * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef ANDROID_CHROMIUM_PREFIX_H #define ANDROID_CHROMIUM_PREFIX_H // C++ specific changes #ifdef __cplusplus #include #include // chromium refers to stl functions without std:: #include using std::find; using std::reverse; using std::search; // Called by command_line.cc to shorten the process name. Not needed for // network stack. #define prctl() (0) namespace std { // our new does not trigger oom inline void set_new_handler(void (*p)()) {} } // Chromium expects size_t to be a signed int on linux but Android defines it // as unsigned. inline size_t abs(size_t x) { return x; } #endif // Needed by base_paths.cc for close() function. #include // Need to define assert before logging.h undefines it. #include // logging.cc needs pthread_mutex_t #include // needed for isalpha #include // needed for sockaddr_in #include // Implemented in bionic but not exposed. extern char* mkdtemp(char* path); #define FRIEND_TEST(test_case_name, test_name)\ friend class test_case_name##_##test_name##_Test // This will probably need a real implementation. //#define F_ULOCK 0 //#define F_LOCK 1 //inline int lockf(int fd, int cmd, off_t len) { return -1; } // We have posix monotonic clocks but don't define this... #define _POSIX_MONOTONIC_CLOCK 1 // Disable langinfo in icu #define U_GAVE_NL_LANGINFO_CODESET 0 // We use the C99 style, but this is not defined #define HAVE_UINT16_T 1 #endif