blob: 792acc3a5f8ab293da5d154963b736e57920c10e [file] [log] [blame]
{% from "macros.tmpl" import license -%}
{{ license() }}
#include "config.h"
#ifdef SKIP_STATIC_CONSTRUCTORS_ON_GCC
#define {{namespace|to_macro_style}}_NAMES_HIDE_GLOBALS 1
#endif
#include "{{namespace}}Names.h"
#include "wtf/StaticConstructors.h"
namespace WebCore {
namespace {{namespace}}Names {
using namespace WTF;
{%- for entry in entries|sort %}
{%- if export %}
DEFINE_GLOBAL(AtomicString, {{entry|symbol}}Storage)
{{export}} const AtomicString& {{entry|symbol}} = *reinterpret_cast<const AtomicString*>(&{{entry|symbol}}Storage);
{%- else %}
DEFINE_GLOBAL(AtomicString, {{entry|symbol}})
{%- endif %}
{%- endfor %}
void init()
{
{%- for entry in entries|sort %}
StringImpl* {{entry|symbol}}Impl = StringImpl::createStatic("{{entry|cpp_name}}", {{entry|cpp_name|length}}, {{entry|cpp_name|hash}});
{%- endfor %}
{%- for entry in entries|sort %}
new ((void*)&{{entry|symbol}}) AtomicString({{entry|symbol}}Impl);
{%- endfor %}
}
} // {{namespace}}
} // WebCore