Bug 1385461 - Document the reason for the time.h-including cc files in SOURCES. draft
authorFrancois Marier <francois@mozilla.com>
Tue, 17 Oct 2017 15:53:54 -0700
changeset 683520 62c4f81435b32d671923c517e409e01f6fc93e06
parent 683519 51f34cd1388263ca63149f1cc5787aa1d1200411
child 683521 57b51fbca2e321157ab0cae9a4715907cd361dcf
push id85402
push userfmarier@mozilla.com
push dateThu, 19 Oct 2017 21:21:03 +0000
bugs1385461
milestone58.0a1
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
toolkit/components/protobuf/moz.build
--- 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'