diff --git a/sandboxed_api/tools/clang_generator/emitter.cc b/sandboxed_api/tools/clang_generator/emitter.cc index 388fa90..79484a2 100644 --- a/sandboxed_api/tools/clang_generator/emitter.cc +++ b/sandboxed_api/tools/clang_generator/emitter.cc @@ -331,6 +331,12 @@ absl::StatusOr EmitHeader( absl::StrAppendFormat(&out, kEmbedInclude, include_file); } + // If specified, wrap the generated API in a namespace + if (options.has_namespace()) { + absl::StrAppendFormat(&out, kNamespaceBeginTemplate, + options.namespace_name); + } + // Emit type dependencies if (!rendered_types.empty()) { absl::StrAppend(&out, "// Types this API depends on\n"); @@ -347,12 +353,6 @@ absl::StatusOr EmitHeader( } } - // If specified, wrap the generated API in a namespace - if (options.has_namespace()) { - absl::StrAppendFormat(&out, kNamespaceBeginTemplate, - options.namespace_name); - } - // Optionally emit a default sandbox that instantiates an embedded sandboxee if (!options.embed_name.empty()) { // TODO(cblichmann): Make the "Sandbox" suffix configurable.