Include the field tags in the generated .pb.h file.
[apps/agl-service-can-low-level.git] / example_avr_double / README.txt
1 Some processors/compilers, such as AVR-GCC, do not support the double
2 datatype. Instead, they have sizeof(double) == 4. Because protocol
3 binary format uses the double encoding directly, this causes trouble
4 if the protocol in .proto requires double fields.
5
6 This directory contains a solution to this problem. It uses uint64_t
7 to store the raw wire values, because its size is correct on all
8 platforms. The file double_conversion.c provides functions that
9 convert these values to/from floats, without relying on compiler
10 support.
11
12 To use this method, you need to make two modifications to your code:
13
14 1) Change all 'double' fields into 'fixed64' in the .proto.
15
16 2) Whenever writing to a 'double' field, use float_to_double().
17
18 3) Whenever reading a 'double' field, use double_to_float().
19
20 The conversion routines should be as accurate as the float datatype can
21 be. Furthermore, they should handle all special values (NaN, inf, denormalized
22 numbers) correctly. There are testcases in test_conversions.c.