Closed Bug 834505 Opened 11 years ago Closed 5 years ago

Wrap WinBase.h in something that #undefs GetCurrentTime macro

Categories

(Firefox Build System :: General, defect)

x86_64
Windows XP
defect
Not set
normal

Tracking

(firefox71 fixed)

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: mikeh, Assigned: karlt)

References

Details

Attachments

(1 file)

This macro conflict with MediaStream::GetCurrentTime() is extremely painful when you hit it, and it doesn't help that the MSVC compiler generates less-than-useful error messages about where exactly the problem is occurring.

This is done almost everywhere anyway:
http://mxr.mozilla.org/mozilla-central/ident?i=GetCurrentTime&filter=
I tried to create a winbase.h in our source tree which is basically like:

#ifndef MOZILLA_WINBASE_H
#define MOZILLA_WINBASE_H

#include_next <winbase.h>
#undef GetCurrentTime

#endif //MOZILLA_WINBASE_H

However, MSVC doesn't support include_next...
I was hit by this on mingw build.

We can do similar way what we did for 'None' defined in X11/X.h.
See Also: → 1288686
Product: Core → Firefox Build System
Assignee: nobody → karlt
Blocks: 1578623
See Also: → 1448426

GetCurrentTime is declared in WinBase.h
https://github.com/tpn/winsdk-10/blob/master/Include/10.0.10240.0/um/WinBase.h#L91

Documentation for functions declared in winbase.h instruct to include
Windows.h. e.g.
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-copyfile
Other macro declarations in winbase.h such as CopyFile() are already adjusted
with this wrapper via windows-h-unicode.decls.h

A similar, but different, static inline could be provided but is not required.

Pushed by ktomlinson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/40b7ff3abf52
undef GetCurrentTime() from windows-h-wrapper.template.h r=glandium
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: