MediaFeatureNames.cpp [plain text]
#include "config.h"
#ifdef SKIP_STATIC_CONSTRUCTORS_ON_GCC
#define CSS_MEDIAQUERY_NAMES_HIDE_GLOBALS 1
#endif
#include "MediaFeatureNames.h"
#include <wtf/StaticConstructors.h>
namespace WebCore {
namespace MediaFeatureNames {
#define DEFINE_MEDIAFEATURE_GLOBAL(name, str) \
DEFINE_GLOBAL(AtomicString, name##MediaFeature, str)
#if PLATFORM(IOS)
CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE_IOS(DEFINE_MEDIAFEATURE_GLOBAL)
#else
CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(DEFINE_MEDIAFEATURE_GLOBAL)
#endif
#undef DEFINE_MEDIAFEATURE_GLOBAL
void init()
{
static bool initialized;
if (!initialized) {
AtomicString::init();
#define INITIALIZE_GLOBAL(name, str) new (NotNull, (void*)&name##MediaFeature) AtomicString(str, AtomicString::ConstructFromLiteral);
#if PLATFORM(IOS)
CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE_IOS(INITIALIZE_GLOBAL)
#else
CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(INITIALIZE_GLOBAL)
#endif
#undef INITIALIZE_GLOBAL
initialized = true;
}
}
} }