Closed ff20509 closed 3 weeks ago
To avoid code duplication for the little-endian, big-endian and native byte order variants of these functions, we use an include file with a generic implementation. The definition for this function is in dds_cdrstream_write.part.h that is included here.
Thanks for the answer, I still have some premature questions. Is dds_stream_writeLE and dds_stream_writeBE the common implementation of dds_stream_writeBO?I see that the header of dds_cdrstream.c has the macro definition #define dds_stream_writeBO NAME_BYTE_ORDER(dds_stream_write), But it does not include the file dds_cdrstream_write.part.h until after it. There seems to be a missing step to make a connection between dds_stream_writeLE and dds_stream_writeBO.
dds_stream_writeBO
is a macro that is expanded each time dds_cdrstream_write.part.h
is included, and the NAME_BYTE_ORDER
macro concatenates the function name (dds_stream_write
) and the byte order extension (LE
, BE
or empty string for native) that results in the actual function name (as declared in dds_cdrstream.h) The function body is expanded three times for these three function names.
Presumed answered in sufficient detail.
Hello, why did I search globally for the dds_stream_writeLE function and only found the function declaration but not the implementation?