summaryrefslogtreecommitdiff
path: root/src/scanner.c
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2016-04-17 12:29:22 +0100
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2016-04-19 11:06:49 +0300
commit05f7aec1d59be56e8f5aaf5445266ac80336dab2 (patch)
tree29e93a36a82f782618bc894edec514812c7bda3d /src/scanner.c
parentae78dcb1ada6033419edcfc93074407518640e42 (diff)
downloadwayland-05f7aec1d59be56e8f5aaf5445266ac80336dab2.tar.gz
scanner: move include directives before extern "C" wrapper
Adding extern "C" wrapper before includes (especially system ones) is illadvised as the headers themselves can behave diffently in that case. See the section "Including C Headers in C++ Code" in the following http://www.oracle.com/technetwork/articles/servers-storage-dev/mixingcandcpluspluscode-305840.html Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Diffstat (limited to 'src/scanner.c')
-rw-r--r--src/scanner.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/scanner.c b/src/scanner.c
index 65df3ae..52c07a6 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -1423,13 +1423,13 @@ emit_header(struct protocol *protocol, enum side side)
printf("#ifndef %s_%s_PROTOCOL_H\n"
"#define %s_%s_PROTOCOL_H\n"
"\n"
+ "#include <stdint.h>\n"
+ "#include <stddef.h>\n"
+ "#include \"%s\"\n\n"
"#ifdef __cplusplus\n"
"extern \"C\" {\n"
"#endif\n"
"\n"
- "#include <stdint.h>\n"
- "#include <stddef.h>\n"
- "#include \"%s\"\n\n"
"struct wl_client;\n"
"struct wl_resource;\n\n",
protocol->uppercase_name, s,