Skip to content

Commit 2391b14

Browse files
committed
Improve header test for C++
This patch ensures that we don't miss G_BEGIN_DECLS/G_END_DECLS on any public header. Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
1 parent 44220c3 commit 2391b14

12 files changed

+37
-0
lines changed

modulemd/common/tests/test-import-headers.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ EOF
4040
-I `dirname $arg` \
4141
-o $header.out \
4242
$header.c
43+
44+
echo "g++ \`pkg-config --cflags gobject-2.0\` \
45+
\`pkg-config --cflags yaml-0.1\` \
46+
-I `dirname $arg` \
47+
-o $header.out \
48+
$header.c"
49+
g++ `pkg-config --cflags gobject-2.0` \
50+
`pkg-config --cflags yaml-0.1` \
51+
-I `dirname $arg` \
52+
-o $header.out \
53+
$header.c
4354
done
4455

4556
popd

modulemd/v2/include/modulemd-2.0/modulemd-buildopts.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,5 @@ modulemd_buildopts_remove_rpm_from_whitelist (ModulemdBuildopts *self,
112112
*/
113113
gchar **
114114
modulemd_buildopts_get_rpm_whitelist_as_strv (ModulemdBuildopts *self);
115+
116+
G_END_DECLS

modulemd/v2/include/modulemd-2.0/modulemd-component-module.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,5 @@ modulemd_component_module_set_repository (ModulemdComponentModule *self,
9191
*/
9292
const gchar *
9393
modulemd_component_module_get_repository (ModulemdComponentModule *self);
94+
95+
G_END_DECLS

modulemd/v2/include/modulemd-2.0/modulemd-component-rpm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,5 @@ modulemd_component_rpm_set_repository (ModulemdComponentRpm *self,
191191
*/
192192
const gchar *
193193
modulemd_component_rpm_get_repository (ModulemdComponentRpm *self);
194+
195+
G_END_DECLS

modulemd/v2/include/modulemd-2.0/modulemd-component.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,5 @@ modulemd_component_set_rationale (ModulemdComponent *self,
109109
*/
110110
const gchar *
111111
modulemd_component_get_rationale (ModulemdComponent *self);
112+
113+
G_END_DECLS

modulemd/v2/include/modulemd-2.0/modulemd-dependencies.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,5 @@ modulemd_dependencies_get_runtime_modules_as_strv (ModulemdDependencies *self);
165165
GStrv
166166
modulemd_dependencies_get_runtime_streams_as_strv (ModulemdDependencies *self,
167167
const gchar *module);
168+
169+
G_END_DECLS

modulemd/v2/include/modulemd-2.0/modulemd-deprecated.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313

1414
#pragma once
1515

16+
#include <glib-object.h>
17+
18+
G_BEGIN_DECLS
19+
1620
#ifdef MMD_DISABLE_DEPRECATION_WARNINGS
1721
#define MMD_DEPRECATED extern
1822
#define MMD_DEPRECATED_FOR(f) extern
@@ -24,3 +28,5 @@
2428
#define MMD_DEPRECATED_TYPE_FOR(f) G_DEPRECATED_FOR (f)
2529
#define MMD_UNAVAILABLE(maj, min) G_UNAVAILABLE (maj, min) extern
2630
#endif
31+
32+
G_END_DECLS

modulemd/v2/include/modulemd-2.0/modulemd-module.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,5 @@ modulemd_module_get_stream_by_NSVC (ModulemdModule *self,
127127
*/
128128
ModulemdDefaults *
129129
modulemd_module_get_defaults (ModulemdModule *self);
130+
131+
G_END_DECLS

modulemd/v2/include/modulemd-2.0/modulemd-profile.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,5 @@ modulemd_profile_remove_rpm (ModulemdProfile *self, const gchar *rpm);
132132
*/
133133
gchar **
134134
modulemd_profile_get_rpms_as_strv (ModulemdProfile *self);
135+
136+
G_END_DECLS

modulemd/v2/include/modulemd-2.0/modulemd-subdocument-info.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,5 @@ modulemd_subdocument_info_get_yaml (ModulemdSubdocumentInfo *self);
5555
*/
5656
const GError *
5757
modulemd_subdocument_info_get_gerror (ModulemdSubdocumentInfo *self);
58+
59+
G_END_DECLS

0 commit comments

Comments
 (0)