mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 16:32:11 +01:00
Generate "WUFFS C HEADER ENDS HERE"
Future commits will mean more than one "#ifdef WUFFS_IMPLEMENTATION".
This commit is contained in:
1 parent
7039a5b9c7
commit
dc17398d64
5 files changed
+6
-4
No files matched your search
@@ -16,6 +16,7 @@
|
||||
|
||||
// !! INSERT base-public.h.
|
||||
|
||||
// WUFFS C HEADER ENDS HERE.
|
||||
#ifdef WUFFS_IMPLEMENTATION
|
||||
|
||||
// !! INSERT base-private.h.
|
||||
|
||||
@@ -778,7 +778,7 @@ func (g *gen) writeCppImpls(b *buffer) error {
|
||||
}
|
||||
|
||||
var (
|
||||
wiStart = []byte("\n#ifdef WUFFS_IMPLEMENTATION\n\n")
|
||||
wiStart = []byte("\n// WUFFS C HEADER ENDS HERE.\n#ifdef WUFFS_IMPLEMENTATION\n\n")
|
||||
wiEnd = []byte("\n#endif // WUFFS_IMPLEMENTATION\n\n")
|
||||
|
||||
wigbpStart = []byte("\n#ifndef WUFFS_INCLUDE_GUARD__BASE_PUBLIC\n")
|
||||
|
||||
@@ -114,7 +114,7 @@ const baseBasePrivateH = "" +
|
||||
""
|
||||
|
||||
const baseBaseImplC = "" +
|
||||
"// Copyright 2018 The Wuffs Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// !! INSERT base-public.h.\n\n#ifdef WUFFS_IMPLEMENTATION\n\n// !! INSERT base-private.h.\n\n#if !defined(WUFFS_CONFIG__MODULES) || defined(WUFFS_CONFIG__MODULE__BASE)\n\n// !! INSERT wuffs_base__status strings.\n\n#endif // !defined(WUFFS_CONFIG__MODULES) ||\n // defined(WUFFS_CONFIG__MODULE__BASE)\n\n#endif // WUFFS_IMPLEMENTATION\n" +
|
||||
"// Copyright 2018 The Wuffs Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// !! INSERT base-public.h.\n\n// WUFFS C HEADER ENDS HERE.\n#ifdef WUFFS_IMPLEMENTATION\n\n// !! INSERT base-private.h.\n\n#if !defined(WUFFS_CONFIG__MODULES) || defined(WUFFS_CONFIG__MODULE__BASE)\n\n// !! INSERT wuffs_base__status strings.\n\n#endif // !defined(WUFFS_CONFIG__MODULES) ||\n // defined(WUFFS_CONFIG__MODULE__BASE)\n\n#endif // WUFFS_IMPLEMENTATION\n" +
|
||||
""
|
||||
|
||||
const baseImagePublicH = "" +
|
||||
|
||||
@@ -79,7 +79,7 @@ func doGenrelease(args []string) error {
|
||||
}
|
||||
}
|
||||
if len(trimmed) == 0 {
|
||||
return fmt.Errorf("could not find %q or %q", grImplStartsHere, grImplEndsHere)
|
||||
return fmt.Errorf("could not find %q or %q in %s", grImplStartsHere, grImplEndsHere, filename)
|
||||
}
|
||||
|
||||
if err := h.gen(unformatted, s); err != nil {
|
||||
@@ -110,7 +110,7 @@ func doGenrelease(args []string) error {
|
||||
}
|
||||
|
||||
var (
|
||||
grImplStartsHere = []byte("#ifdef WUFFS_IMPLEMENTATION\n")
|
||||
grImplStartsHere = []byte("\n// WUFFS C HEADER ENDS HERE.\n#ifdef WUFFS_IMPLEMENTATION\n")
|
||||
grImplEndsHere = []byte("#endif // WUFFS_IMPLEMENTATION\n")
|
||||
grNN = []byte("\n\n")
|
||||
grVOverride = []byte("// !! Some code generation programs can override WUFFS_VERSION.\n")
|
||||
|
||||
@@ -3121,6 +3121,7 @@ wuffs_zlib__decoder::decode(wuffs_base__io_writer a_dst,
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
// WUFFS C HEADER ENDS HERE.
|
||||
#ifdef WUFFS_IMPLEMENTATION
|
||||
|
||||
// Copyright 2017 The Wuffs Authors.
|
||||
|
||||
Reference in new issue
Block a user