Skip to content

Commit

Permalink
Applied suggestion from comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Michelle Vu authored and eboasson committed Oct 1, 2024
1 parent e876621 commit 5942fce
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/idlcxx/src/generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,15 +898,12 @@ generate_includes(const idl_pstate_t *pstate, struct generator *generator)
if (fputs("\n", generator->header.handle) < 0)
return IDL_RETCODE_NO_MEMORY;

if (generator->uses_array || generator->uses_sequence || generator->uses_bounded_sequence || generator->uses_optional)
{
// ostream hpp
// streaming operators for the used std types
const char *fmt;
fmt = "#include <org/eclipse/cyclonedds/util/ostream_operators.hpp>\n\n";
if (fputs(fmt, generator->header.handle) < 0)
return IDL_RETCODE_NO_MEMORY;
}
// ostream cpp
// streaming operators for the used std types
static const char *fmt = "#include <org/eclipse/cyclonedds/util/ostream_operators.hpp>\n\n";

if (fputs(fmt, generator->impl.handle) < 0)
return IDL_RETCODE_NO_MEMORY;

return IDL_RETCODE_OK;
}
Expand Down

0 comments on commit 5942fce

Please sign in to comment.