/* * 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 ChromiumIncludes_h #define ChromiumIncludes_h #include "config.h" // Include all external/chromium files in this file so the problems with the LOG // and LOG_ASSERT defines can be handled in one place. // Undefine LOG and LOG_ASSERT before including chrome code, and if they were // defined attempt to set the macros to the Android logging macros (which are // the only ones that actually log). #ifdef LOG #define LOG_WAS_DEFINED LOG #undef LOG #endif #ifdef LOG_ASSERT #define LOG_ASSERT_WAS_DEFINED LOG_ASSERT #undef LOG_ASSERT #endif // Chromium won't build without NDEBUG set, so we set it for all source files // that use Chromium code. This means that if NDEBUG was previously unset, we // have to redefine ASSERT() to a no-op, as this is enabled in debug builds. // Unfortunately, ASSERT() is defined from config.h, so we can't get in first. #ifndef NDEBUG #define NDEBUG 1 #undef ASSERT #define ASSERT(assertion) (void(0)) #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if ENABLE(WEB_AUTOFILL) #include #include #include #include #include #include #include #include #include #include #include #include #endif #undef LOG #if defined(LOG_WAS_DEFINED) && defined(LOG_PRI) #define LOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__) #endif #undef LOG_ASSERT #if defined(LOG_ASSERT_WAS_DEFINED) && defined(LOG_FATAL_IF) #define LOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ## __VA_ARGS__) #endif #endif