1.1 --- a/main.c Sat Apr 18 17:44:37 2020 +0200
1.2 +++ b/main.c Mon Apr 20 23:54:38 2020 +0200
1.3 @@ -263,7 +263,11 @@
1.4
1.5 /* Begin generating any compound interface code. */
1.6
1.7 - begin_compound_output();
1.8 + if (!begin_compound_output())
1.9 + {
1.10 + end_compound_output();
1.11 + return 1;
1.12 + }
1.13
1.14 /* Process named files. */
1.15
2.1 --- a/program.c Sat Apr 18 17:44:37 2020 +0200
2.2 +++ b/program.c Mon Apr 20 23:54:38 2020 +0200
2.3 @@ -1,7 +1,7 @@
2.4 /*
2.5 * Code generation from interface descriptions.
2.6 *
2.7 - * Copyright (C) 2019 Paul Boddie <paul@boddie.org.uk>
2.8 + * Copyright (C) 2019, 2020 Paul Boddie <paul@boddie.org.uk>
2.9 *
2.10 * This program is free software; you can redistribute it and/or
2.11 * modify it under the terms of the GNU General Public License as
2.12 @@ -112,13 +112,13 @@
2.13
2.14 /* Generate compound code output, if requested. */
2.15
2.16 -void begin_compound_output(void)
2.17 +int begin_compound_output(void)
2.18 {
2.19 char *compound_dirname = conf.output_dir != NULL ? conf.output_dir : ".";
2.20 char *s;
2.21
2.22 if (conf.compound == NULL)
2.23 - return;
2.24 + return 1;
2.25
2.26 processed_interfaces = 0;
2.27
2.28 @@ -127,7 +127,7 @@
2.29 compound_dispatch_header_fp = get_output_file(server_header_filename,
2.30 compound_dirname, conf.compound);
2.31 if (compound_dispatch_header_fp == NULL)
2.32 - goto fail;
2.33 + return 0;
2.34 }
2.35
2.36 if (conf.interfaces)
2.37 @@ -135,12 +135,12 @@
2.38 compound_interface_fp = get_output_file(interface_filename,
2.39 compound_dirname, conf.compound);
2.40 if (compound_interface_fp == NULL)
2.41 - goto fail;
2.42 + return 0;
2.43
2.44 compound_interfaces_fp = get_output_file(compound_interfaces_filename,
2.45 compound_dirname, conf.compound);
2.46 if (compound_interfaces_fp == NULL)
2.47 - goto fail;
2.48 + return 0;
2.49 }
2.50
2.51 if (conf.routines)
2.52 @@ -149,7 +149,7 @@
2.53 server_filename_c;
2.54 compound_dispatch_fp = get_output_file(s, compound_dirname, conf.compound);
2.55 if (compound_dispatch_fp == NULL)
2.56 - goto fail;
2.57 + return 0;
2.58 }
2.59
2.60 /* Emit prologues. */
2.61 @@ -192,10 +192,7 @@
2.62 if (compound_interfaces_fp != NULL)
2.63 fputs(compound_interfaces_prologue, compound_interfaces_fp);
2.64
2.65 - return;
2.66 -
2.67 -fail:
2.68 - end_compound_output();
2.69 + return 1;
2.70 }
2.71
2.72 void write_compound_output(struct interface *iface)
3.1 --- a/program.h Sat Apr 18 17:44:37 2020 +0200
3.2 +++ b/program.h Mon Apr 20 23:54:38 2020 +0200
3.3 @@ -1,7 +1,7 @@
3.4 /*
3.5 * Client code generation.
3.6 *
3.7 - * Copyright (C) 2019 Paul Boddie <paul@boddie.org.uk>
3.8 + * Copyright (C) 2019, 2020 Paul Boddie <paul@boddie.org.uk>
3.9 *
3.10 * This program is free software; you can redistribute it and/or
3.11 * modify it under the terms of the GNU General Public License as
3.12 @@ -26,7 +26,7 @@
3.13
3.14 /* Component-level processing. */
3.15
3.16 -void begin_compound_output(void);
3.17 +int begin_compound_output(void);
3.18 void write_compound_output(struct interface *iface);
3.19 void write_compound_dispatch_include(void);
3.20 void write_compound_interface(struct interface *iface);