From: Emil Velikov Date: Sun, 17 Apr 2016 11:29:22 +0000 (+0100) Subject: scanner: move include directives before extern "C" wrapper X-Git-Tag: 1.10.91~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05f7aec1d59be56e8f5aaf5445266ac80336dab2;p=platform%2Fupstream%2Fwayland.git 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 Reviewed-by: Pekka Paalanen Reviewed-by: Quentin Glidic --- 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 \n" + "#include \n" + "#include \"%s\"\n\n" "#ifdef __cplusplus\n" "extern \"C\" {\n" "#endif\n" "\n" - "#include \n" - "#include \n" - "#include \"%s\"\n\n" "struct wl_client;\n" "struct wl_resource;\n\n", protocol->uppercase_name, s,