# 1 "" # 1 "./../../../mozilla-config.h" 1 /* List of defines generated by configure. Included with preprocessor flag, * -include, to avoid long list of -D defines on the compile command-line. * Do not edit. */ #ifndef MOZILLA_CONFIG_H #define MOZILLA_CONFIG_H #if defined(__clang__) #pragma clang diagnostic push #if __has_warning("-Wreserved-id-macro") #pragma clang diagnostic ignored "-Wreserved-id-macro" #endif # 14 "./../../../mozilla-config.h" #endif # 15 "./../../../mozilla-config.h" #define A11Y_LOG 1 #define ACCESSIBILITY 1 #define ATK_MAJOR_VERSION 2 #define ATK_MINOR_VERSION 14 #define ATK_REV_VERSION 0 #define ATTRIBUTE_ALIGNED_MAX 64 #define BUILD_CTYPES 1 #define D_INO d_ino #define E10S_TESTING_ONLY 1 #define EARLY_BETA_OR_EARLIER 1 #define ENABLE_INTL_API 1 #define ENABLE_MARIONETTE 1 #define ENABLE_SYSTEM_EXTENSION_DIRS 1 #define EXPOSE_INTL_API 1 #define FIREFOX_VERSION 39.0a1 #define FORCE_PR_LOG 1 #define FUNCPROTO 15 #define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_26 #define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_26 #define GL_PROVIDER_GLX 1 #define GST_API_VERSION "1.0" #define HAVE_64BIT_BUILD 1 #define HAVE_ALLOCA_H 1 #define HAVE_BYTESWAP_H 1 #define HAVE_CLOCK_MONOTONIC 1 #define HAVE_CPUID_H 1 #define HAVE_DIRENT_H 1 #define HAVE_DLADDR 1 #define HAVE_DLOPEN 1 #define HAVE_FONTCONFIG_FCFREETYPE_H 1 #define HAVE_FT_BITMAP_SIZE_Y_PPEM 1 #define HAVE_FT_GLYPHSLOT_EMBOLDEN 1 #define HAVE_FT_LOAD_SFNT_TABLE 1 #define HAVE_GETOPT_H 1 #define HAVE_GMTIME_R 1 #define HAVE_GNU_LIBC_VERSION_H 1 #define HAVE_I18N_LC_MESSAGES 1 #define HAVE_INTTYPES_H 1 #define HAVE_LANGINFO_CODESET 1 #define HAVE_LIBPNG 1 #define HAVE_LIBVPX 1 #define HAVE_LIBXSS 1 #define HAVE_LINUX_IF_ADDR_H 1 #define HAVE_LINUX_QUOTA_H 1 #define HAVE_LINUX_RTNETLINK_H 1 #define HAVE_LOCALECONV 1 #define HAVE_LOCALTIME_R 1 #define HAVE_LSTAT64 1 #define HAVE_MALLOC_H 1 #define HAVE_MALLOC_H 1 #define HAVE_MALLOC_USABLE_SIZE 1 #define HAVE_MEMALIGN 1 #define HAVE_MEMMEM 1 #define HAVE_MEMORY_H 1 #define HAVE_NETINET_IN_H 1 #define HAVE_NL_TYPES_H 1 #define HAVE_POSIX_FADVISE 1 #define HAVE_POSIX_FALLOCATE 1 #define HAVE_POSIX_MEMALIGN 1 #define HAVE_RES_NINIT 1 #define HAVE_STAT64 1 #define HAVE_STDINT_H 1 #define HAVE_STRNDUP 1 #define HAVE_SYS_BITYPES_H 1 #define HAVE_SYS_CDEFS_H 1 #define HAVE_SYS_QUOTA_H 1 #define HAVE_SYS_SYSMACROS_H 1 #define HAVE_SYS_TYPES_H 1 #define HAVE_THREAD_TLS_KEYWORD 1 #define HAVE_TRUNCATE64 1 #define HAVE_UNISTD_H 1 #define HAVE_VALLOC 1 #define HAVE_VA_COPY 1 #define HAVE_VA_LIST_AS_ARRAY 1 #define HAVE_VISIBILITY_ATTRIBUTE 1 #define HAVE_VISIBILITY_HIDDEN_ATTRIBUTE 1 #define HAVE_X11_XKBLIB_H 1 #define HAVE__UNWIND_BACKTRACE 1 #define HAVE___CXA_DEMANGLE 1 #define JS_DEFAULT_JITREPORT_GRANULARITY 3 #define MALLOC_H #define MALLOC_USABLE_SIZE_CONST_PTR #define MOZILLA_UAVERSION "39.0" #define MOZILLA_VERSION "39.0a1" #define MOZILLA_VERSION_U 39.0a1 #define MOZ_ACCESSIBILITY_ATK 1 #define MOZ_ACTIVITIES 1 #define MOZ_APP_UA_NAME "" #define MOZ_APP_UA_VERSION "39.0a1" #define MOZ_B2G_OS_NAME "" #define MOZ_B2G_VERSION "1.0.0" #define MOZ_BUILD_APP browser #define MOZ_CLANG_PLUGIN 1 #define MOZ_CRASHREPORTER_ENABLE_PERCENT 100 #define MOZ_DATA_REPORTING 1 #define MOZ_DEBUG_SYMBOLS 1 #define MOZ_DISABLE_PARENTAL_CONTROLS 1 #define MOZ_DISTRIBUTION_ID "org.mozilla" #define MOZ_DLL_SUFFIX ".so" #define MOZ_EME 1 #define MOZ_ENABLE_PROFILER_SPS 1 #define MOZ_ENABLE_SKIA 1 #define MOZ_ENABLE_XREMOTE 1 #define MOZ_FEEDS 1 #define MOZ_FFMPEG 1 #define MOZ_FMP4 1 #define MOZ_GMP_SANDBOX 1 #define MOZ_GSTREAMER 1 #define MOZ_INSTRUMENT_EVENT_LOOP 1 #define MOZ_JSDOWNLOADS 1 #define MOZ_LOGGING 1 #define MOZ_MACBUNDLE_ID org.mozilla.firefox #define MOZ_MEDIA_NAVIGATOR 1 #define MOZ_OFFICIAL_BRANDING 1 #define MOZ_OMNIJAR 1 #define MOZ_PAY 1 #define MOZ_PDF_PRINTING 1 #define MOZ_PEERCONNECTION 1 #define MOZ_PHOENIX 1 #define MOZ_PLACES 1 #define MOZ_PROFILELOCKING 1 #define MOZ_RAW 1 #define MOZ_SAMPLE_TYPE_FLOAT32 1 #define MOZ_SANDBOX 1 #define MOZ_SCTP 1 #define MOZ_SECUREELEMENT 1 #define MOZ_SERVICES_CLOUDSYNC 1 #define MOZ_SERVICES_COMMON 1 #define MOZ_SERVICES_CRYPTO 1 #define MOZ_SERVICES_HEALTHREPORT 1 #define MOZ_SERVICES_METRICS 1 #define MOZ_SERVICES_SYNC 1 #define MOZ_SOCIAL 1 #define MOZ_SRTP 1 #define MOZ_STACKWALKING 1 #define MOZ_STATIC_JS 1 #define MOZ_TELEMETRY_DISPLAY_REV 2 #define MOZ_UPDATE_CHANNEL default #define MOZ_USER_DIR ".mozilla" #define MOZ_VALGRIND 1 #define MOZ_VORBIS 1 #define MOZ_VPX 1 #define MOZ_VPX_ERROR_CONCEALMENT 1 #define MOZ_VPX_NO_MEM_REPORTING 1 #define MOZ_WAVE 1 #define MOZ_WEBAPP_RUNTIME 1 #define MOZ_WEBGL_CONFORMANT 1 #define MOZ_WEBM 1 #define MOZ_WEBM_ENCODER 1 #define MOZ_WEBRTC 1 #define MOZ_WEBRTC_ASSERT_ALWAYS 1 #define MOZ_WEBRTC_SIGNALING 1 #define MOZ_WEBSPEECH 1 #define MOZ_WIDGET_GTK 2 #define MOZ_WIDGET_GTK2 1 #define MOZ_X11 1 #define MOZ_XUL 1 #define NIGHTLY_BUILD 1 #define NS_ATTR_MALLOC __attribute__((malloc)) #define NS_PRINTING 1 #define NS_PRINT_PREVIEW 1 #define NS_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #define STDC_HEADERS 1 #define TARGET_XPCOM_ABI "x86_64-gcc3" #define USE_SKIA 1 #define USE_SKIA_GPU 1 #define U_STATIC_IMPLEMENTATION 1 #define U_USING_ICU_NAMESPACE 0 #define VA_COPY va_copy #define XP_LINUX 1 #define XP_UNIX 1 #define _REENTRANT 1 /* * The c99 defining the limit macros (UINT32_MAX for example), says: * * C++ implementations should define these macros only when * __STDC_LIMIT_MACROS is defined before is included. * * The same also occurs with __STDC_CONSTANT_MACROS for the constant macros * (INT8_C for example) used to specify a literal constant of the proper type, * and with __STDC_FORMAT_MACROS for the format macros (PRId32 for example) used * with the fprintf function family. */ #define __STDC_LIMIT_MACROS #define __STDC_CONSTANT_MACROS #if !defined(__STDC_FORMAT_MACROS) #define __STDC_FORMAT_MACROS #endif # 205 "./../../../mozilla-config.h" #if defined(__clang__) #pragma clang diagnostic pop #endif # 209 "./../../../mozilla-config.h" /* * Force-include Char16.h in order to define PRUnichar as char16_t everywhere. * Note that this should be the first #include to make sure that prtypes.h does * not attempt to define PRUnichar. This includes the following hunspell-specific * includes. * * We don't use this to build elfhack and elf-dynstr-gc since those builds happen * during the export tier. Also, disable this when building assembly files too. */ #if !defined(ELFHACK_BUILD) && !defined(__ASSEMBLER__) #if 0 /* expanded by -frewrite-includes */ #include "mozilla/Char16.h" #endif /* expanded by -frewrite-includes */ # 220 "./../../../mozilla-config.h" # 1 "../../../dist/include/mozilla/Char16.h" 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* Implements a UTF-16 character type. */ #ifndef mozilla_Char16_h #define mozilla_Char16_h #ifdef __cplusplus /* * C++11 introduces a char16_t type and support for UTF-16 string and character * literals. C++11's char16_t is a distinct builtin type. Technically, char16_t * is a 16-bit code unit of a Unicode code point, not a "character". */ #if defined(_MSC_VER) && _MSC_VER < 1900 /* * C++11 says char16_t is a distinct builtin type, but Windows's yvals.h * typedefs char16_t as an unsigned short prior to MSVC 2015, which * implemented C++11's distinct char16_t type. We would like to alias * char16_t to Windows's 16-bit wchar_t so we can declare UTF-16 literals as * constant expressions (and pass char16_t pointers to Windows APIs). We * #define _CHAR16T here in order to prevent yvals.h from overriding our * char16_t typedefs, which we set to wchar_t for C++ code. * * In addition, #defining _CHAR16T will prevent yvals.h from defining a * char32_t type, so we have to undo that damage here and provide our own, * which is identical to the yvals.h type. */ # define MOZ_UTF16_HELPER(s) L##s # define _CHAR16T typedef wchar_t char16_t; typedef unsigned int char32_t; #else # 39 "../../../dist/include/mozilla/Char16.h" /* C++11 has a builtin char16_t type. */ # define MOZ_UTF16_HELPER(s) u##s /** * This macro is used to distinguish when char16_t would be a distinct * typedef from wchar_t. */ # define MOZ_CHAR16_IS_NOT_WCHAR # ifdef WIN32 # define MOZ_USE_CHAR16_WRAPPER # endif # 49 "../../../dist/include/mozilla/Char16.h" #endif # 50 "../../../dist/include/mozilla/Char16.h" #ifdef MOZ_USE_CHAR16_WRAPPER #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 52 "../../../dist/include/mozilla/Char16.h" # 53 "../../../dist/include/mozilla/Char16.h" /** * Win32 API extensively uses wchar_t, which is represented by a separated * builtin type than char16_t per spec. It's not the case for MSVC prior to * MSVC 2015, but other compilers follow the spec. We want to mix wchar_t and * char16_t on Windows builds. This class is supposed to make it easier. It * stores char16_t const pointer, but provides implicit casts for wchar_t as * well. On other platforms, we simply use * |typedef const char16_t* char16ptr_t|. Here, we want to make the class as * similar to this typedef, including providing some casts that are allowed * by the typedef. */ class char16ptr_t { private: const char16_t* mPtr; static_assert(sizeof(char16_t) == sizeof(wchar_t), "char16_t and wchar_t sizes differ"); public: char16ptr_t(const char16_t* aPtr) : mPtr(aPtr) {} char16ptr_t(const wchar_t* aPtr) : mPtr(reinterpret_cast(aPtr)) {} /* Without this, nullptr assignment would be ambiguous. */ constexpr char16ptr_t(decltype(nullptr)) : mPtr(nullptr) {} operator const char16_t*() const { return mPtr; } operator const wchar_t*() const { return reinterpret_cast(mPtr); } operator const void*() const { return mPtr; } operator bool() const { return mPtr != nullptr; } operator std::wstring() const { return std::wstring(static_cast(*this)); } /* Explicit cast operators to allow things like (char16_t*)str. */ explicit operator char16_t*() const { return const_cast(mPtr); } explicit operator wchar_t*() const { return const_cast(static_cast(*this)); } explicit operator int() const { return reinterpret_cast(mPtr); } explicit operator unsigned int() const { return reinterpret_cast(mPtr); } explicit operator long() const { return reinterpret_cast(mPtr); } explicit operator unsigned long() const { return reinterpret_cast(mPtr); } explicit operator long long() const { return reinterpret_cast(mPtr); } explicit operator unsigned long long() const { return reinterpret_cast(mPtr); } /** * Some Windows API calls accept BYTE* but require that data actually be * WCHAR*. Supporting this requires explicit operators to support the * requisite explicit casts. */ explicit operator const char*() const { return reinterpret_cast(mPtr); } explicit operator const unsigned char*() const { return reinterpret_cast(mPtr); } explicit operator unsigned char*() const { return const_cast(reinterpret_cast(mPtr)); } explicit operator void*() const { return const_cast(mPtr); } /* Some operators used on pointers. */ char16_t operator[](size_t aIndex) const { return mPtr[aIndex]; } bool operator==(const char16ptr_t& aOther) const { return mPtr == aOther.mPtr; } bool operator==(decltype(nullptr)) const { return mPtr == nullptr; } bool operator!=(const char16ptr_t& aOther) const { return mPtr != aOther.mPtr; } bool operator!=(decltype(nullptr)) const { return mPtr != nullptr; } char16ptr_t operator+(int aValue) const { return char16ptr_t(mPtr + aValue); } char16ptr_t operator+(unsigned int aValue) const { return char16ptr_t(mPtr + aValue); } char16ptr_t operator+(long aValue) const { return char16ptr_t(mPtr + aValue); } char16ptr_t operator+(unsigned long aValue) const { return char16ptr_t(mPtr + aValue); } char16ptr_t operator+(long long aValue) const { return char16ptr_t(mPtr + aValue); } char16ptr_t operator+(unsigned long long aValue) const { return char16ptr_t(mPtr + aValue); } ptrdiff_t operator-(const char16ptr_t& aOther) const { return mPtr - aOther.mPtr; } }; inline decltype((char*)0-(char*)0) operator-(const char16_t* aX, const char16ptr_t aY) { return aX - static_cast(aY); } #else # 216 "../../../dist/include/mozilla/Char16.h" typedef const char16_t* char16ptr_t; #endif # 220 "../../../dist/include/mozilla/Char16.h" /* * Macro arguments used in concatenation or stringification won't be expanded. * Therefore, in order for |MOZ_UTF16(FOO)| to work as expected (which is to * expand |FOO| before doing whatever |MOZ_UTF16| needs to do to it) a helper * macro, |MOZ_UTF16_HELPER| needs to be inserted in between to allow the macro * argument to expand. See "3.10.6 Separate Expansion of Macro Arguments" of the * CPP manual for a more accurate and precise explanation. */ #define MOZ_UTF16(s) MOZ_UTF16_HELPER(s) static_assert(sizeof(char16_t) == 2, "Is char16_t type 16 bits?"); static_assert(char16_t(-1) > char16_t(0), "Is char16_t type unsigned?"); static_assert(sizeof(MOZ_UTF16('A')) == 2, "Is char literal 16 bits?"); static_assert(sizeof(MOZ_UTF16("")[0]) == 2, "Is string char 16 bits?"); #endif # 237 "../../../dist/include/mozilla/Char16.h" #endif /* mozilla_Char16_h */ # 239 "../../../dist/include/mozilla/Char16.h" # 221 "./../../../mozilla-config.h" 2 #endif # 222 "./../../../mozilla-config.h" /* * Force-include hunspell_alloc_hooks.h and hunspell_fopen_hooks.h for hunspell, * so that we don't need to modify them directly. * * HUNSPELL_STATIC is defined in extensions/spellcheck/hunspell/src/Makefile.in, * unless --enable-system-hunspell is defined. */ #if defined(HUNSPELL_STATIC) #if 0 /* expanded by -frewrite-includes */ #include "hunspell_alloc_hooks.h" #endif /* expanded by -frewrite-includes */ # 231 "./../../../mozilla-config.h" # 232 "./../../../mozilla-config.h" #if 0 /* expanded by -frewrite-includes */ #include "hunspell_fopen_hooks.h" #endif /* expanded by -frewrite-includes */ # 232 "./../../../mozilla-config.h" # 233 "./../../../mozilla-config.h" #endif # 234 "./../../../mozilla-config.h" /* * Force-include sdkdecls.h for building the chromium sandbox code. * * CHROMIUM_SANDBOX_BUILD is defined in security/sandbox/moz.build. * Note that this include path relies on the LOCAL_INCLUDES in that file. */ #if defined(CHROMIUM_SANDBOX_BUILD) && defined(XP_WIN) #if 0 /* expanded by -frewrite-includes */ #include "base/win/sdkdecls.h" #endif /* expanded by -frewrite-includes */ # 242 "./../../../mozilla-config.h" # 243 "./../../../mozilla-config.h" #endif # 244 "./../../../mozilla-config.h" #endif /* MOZILLA_CONFIG_H */ # 246 "./../../../mozilla-config.h" # 1 "" 2 # 1 "/home/alex/gecko-dev/build/clang-plugin/tests/TestNANTestingExprC.c" /* expected-no-diagnostics */ void test(int x); void foo() { float f, f2; typedef double mydouble; mydouble d; double d2; test(f == f); test(d == d); test(f != f); test(d != d); test(f != d); test(d == (d - f)); test(f == f2); test(d == d2); test(d + 1 == d); }