Bug 1385461 - Document the reason for the time.h-including cc files in SOURCES. r=glandium
authorFrancois Marier <francois@mozilla.com>
Tue, 17 Oct 2017 15:53:54 -0700
changeset 387820 2b5488022b9fc0d412abfdb0259533bb05ab0e8f
parent 387819 aca83df2ce2ea49465468a5ae3bd617fdff95dc6
child 387821 cd5b5f3af51751a3aaeba564d5faaa21fb0641f4
push id96497
push userarchaeopteryx@coole-files.de
push dateTue, 24 Oct 2017 09:57:53 +0000
treeherdermozilla-inbound@7de3cc48b5b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1385461
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1385461 - Document the reason for the time.h-including cc files in SOURCES. r=glandium 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'