1
0
mirror of https://github.com/OlafvdSpek/ctemplate.git synced 2025-09-28 19:05:49 +08:00
ctemplate/m4/google_namespace.m4
csilvers 7be95f773c Tue Aug 19 16:20:27 2008 Google Inc. <opensource@google.com>
* ctemplate: version 0.91 release
	* NEW FEATURE: "separator" sections (csilvers)
	* NEW FEATURE: changing the markup separator via {{=XXX YYY=}} (csilvers)
	* NEW FEATURE: Add an Expand modifier to template dictionary (turnidge)
	* TemplateAsString class -> Template::RegisterStringAsTemplate (edwardcu)
	* TemplateModifier class -> PerExpandData class (csilvers)
	* Store more data in the arena, shrinking TemplateDictionary (csilvers)
	* Use TemplateString more widely internally; small speedup (adamk)
	* Lazily initialize hash-maps, saving time and space (csilvers)
	* Make template annotations more efficient (turnidge)
	* PORTABILITY: Fixed a testing script to run on solaris x86 (csilvers)
	* Fix namespaces to start with :: (csilvers)
	* Improve html parser in various ways (falmeida)
2008-08-21 00:54:27 +00:00

43 lines
2.1 KiB
Plaintext

# Allow users to override the namespace we define our application's classes in
# Arg $1 is the default namespace to use if --enable-namespace isn't present.
# In general, $1 should be 'google', so we put all our exported symbols in a
# unique namespace that is not likely to conflict with anyone else. However,
# when it makes sense -- for instance, when publishing stl-like code -- you
# may want to go with a different default, like 'std'.
# We guarantee the invariant that GOOGLE_NAMESPACE starts with ::,
# unless it's the empty string. Thus, it's always safe to do
# GOOGLE_NAMESPACE::foo and be sure you're getting the foo that's
# actually in the google namespace, and not some other namespace that
# the namespace rules might kick in.
AC_DEFUN([AC_DEFINE_GOOGLE_NAMESPACE],
[google_namespace_default=[$1]
AC_ARG_ENABLE(namespace, [ --enable-namespace=FOO to define these Google
classes in the FOO namespace. --disable-namespace
to define them in the global namespace. Default
is to define them in namespace $1.],
[case "$enableval" in
yes) google_namespace="$google_namespace_default" ;;
no) google_namespace="" ;;
*) google_namespace="$enableval" ;;
esac],
[google_namespace="$google_namespace_default"])
if test -n "$google_namespace"; then
ac_google_namespace="::$google_namespace"
ac_google_start_namespace="namespace $google_namespace {"
ac_google_end_namespace="}"
else
ac_google_namespace=""
ac_google_start_namespace=""
ac_google_end_namespace=""
fi
AC_DEFINE_UNQUOTED(GOOGLE_NAMESPACE, $ac_google_namespace,
Namespace for Google classes)
AC_DEFINE_UNQUOTED(_START_GOOGLE_NAMESPACE_, $ac_google_start_namespace,
Puts following code inside the Google namespace)
AC_DEFINE_UNQUOTED(_END_GOOGLE_NAMESPACE_, $ac_google_end_namespace,
Stops putting the code inside the Google namespace)
])