Skip to content

Commit

Permalink
only include ostream std operators when they actual used
Browse files Browse the repository at this point in the history
  • Loading branch information
trittsv authored and eboasson committed Mar 13, 2024
1 parent 6437010 commit 1faf2a1
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/idlcxx/src/generator.c
Expand Up @@ -899,12 +899,15 @@ generate_includes(const idl_pstate_t *pstate, struct generator *generator)
if (fputs("\n", generator->header.handle) < 0)
return IDL_RETCODE_NO_MEMORY;

// ostream cpp
// streaming goperators for the used std types
const char *fmt;
fmt = "#include <org/eclipse/cyclonedds/util/ostream_operators.hpp>\n\n";
if (fputs(fmt, generator->impl.handle) < 0)
return IDL_RETCODE_NO_MEMORY;
if (generator->uses_array || generator->uses_sequence || generator->uses_bounded_sequence || generator->uses_optional)
{
// ostream cpp
// streaming goperators for the used std types
const char *fmt;
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 1faf2a1

Please sign in to comment.