Bug 1385461 - Document the reason for the time.h-including cc files in SOURCES.
On Windows, GetCurrentTime() is an alias for GetTickCount():
DWORD WINAPI GetTickCount(void);
which comes from winbase.h:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724408(v=vs.85).aspx
In order to add the files that use time.h to UNIFIED_SOURCES, we'd
have to add a hack similar to the one that's in util/time_util.h:
https://github.com/google/protobuf/blob/b04e5cba356212e4e8c66c61bbe0c3a20537c5b9/src/google/protobuf/util/time_util.h#L94-L96
In the interest of patching upstream source as little as possible,
we leave these files in SOURCES instead.
MozReview-Commit-ID: BHCtTCQw9EU
--- a/toolkit/components/protobuf/moz.build
+++ b/toolkit/components/protobuf/moz.build
@@ -221,25 +221,25 @@ UNIFIED_SOURCES += [
'src/google/protobuf/wire_format_lite.cc',
'src/google/protobuf/wrappers.pb.cc',
]
SOURCES += [
'src/google/protobuf/extension_set_heavy.cc',
'src/google/protobuf/generated_message_table_driven.cc',
'src/google/protobuf/generated_message_table_driven_lite.cc',
- 'src/google/protobuf/stubs/time.cc',
+ 'src/google/protobuf/stubs/time.cc', # GetCurrentTime conflict in winbase.h
'src/google/protobuf/util/internal/json_escaping.cc',
'src/google/protobuf/util/internal/json_objectwriter.cc',
'src/google/protobuf/util/internal/json_stream_parser.cc',
- 'src/google/protobuf/util/internal/proto_writer.cc',
- 'src/google/protobuf/util/internal/protostream_objectsource.cc',
- 'src/google/protobuf/util/internal/protostream_objectwriter.cc',
+ 'src/google/protobuf/util/internal/proto_writer.cc', # GetCurrentTime conflict in winbase.h
+ 'src/google/protobuf/util/internal/protostream_objectsource.cc', # GetCurrentTime conflict in winbase.h
+ 'src/google/protobuf/util/internal/protostream_objectwriter.cc', # GetCurrentTime conflict in winbase.h
'src/google/protobuf/util/message_differencer.cc',
- 'src/google/protobuf/util/time_util.cc',
+ 'src/google/protobuf/util/time_util.cc', # GetCurrentTime conflict in winbase.h
'src/google/protobuf/wire_format.cc',
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
FINAL_LIBRARY = 'xul'