extern "C" ... to G_(BEGIN|END)_DECLS
Yoichi Imai <[email protected]> Sat, 25 Dec 2004 18:52:20 +0900
| Newsgroups | gmane.comp.gnome.devtools.gob.general |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --Multipart=_Sat__25_Dec_2004_18_52_20_+0900_babpiirjYZMgxV_v Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi, I wrote a patch to use G_(BEGIN|END)_DECLS macro instead of extern "C" .... These macros are defined in GLib-2.0.0 at least, I think we can use these. -- Yoichi Imai <[email protected]> --Multipart=_Sat__25_Dec_2004_18_52_20_+0900_babpiirjYZMgxV_v Content-Type: text/plain; name="gob2-cpp-decls.patch" Content-Disposition: attachment; filename="gob2-cpp-decls.patch" Content-Transfer-Encoding: quoted-printable --- src.orig/main.c 2004-10-27 08:23:48.000000000 +0900 +++ src/main.c 2004-12-25 17:35:15.696139536 +0900 @@ -3670,13 +3670,9 @@ g_free(p); =20 if( ! no_extern_c) { - out_printf(outh, "#ifdef __cplusplus\n" - "extern \"C\" {\n" - "#endif /* __cplusplus */\n\n"); + out_printf(outh, "G_BEGIN_DECLS\n"); if(outph) - out_printf(outph, "#ifdef __cplusplus\n" - "extern \"C\" {\n" - "#endif /* __cplusplus */\n\n"); + out_printf(outph, "G_BEGIN_DECLS\n"); } } =20 @@ -3684,15 +3680,11 @@ print_header_postfixes(void) { if( ! no_extern_c) - out_printf(outh, "\n#ifdef __cplusplus\n" - "}\n" - "#endif /* __cplusplus */\n"); + out_printf(outh, "\nG_END_DECLS\n"); out_printf(outh, "\n#endif\n"); if(outph) { if( ! no_extern_c) - out_printf(outph, "\n#ifdef __cplusplus\n" - "}\n" - "#endif /* __cplusplus */\n"); + out_printf(outph, "\nG_END_DECLS\n"); out_printf(outph, "\n#endif\n"); } } --Multipart=_Sat__25_Dec_2004_18_52_20_+0900_babpiirjYZMgxV_v-- -- to unsubscribe: send mail to [email protected] with "unsubscribe gob-list" in the subject