Bug 834505 undef GetCurrentTime() from windows-h-wrapper.template.h r=glandium

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.

Differential Revision: https://phabricator.services.mozilla.com/D45288

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Karl Tomlinson 2019-09-18 02:52:20 +00:00
parent 6d82c4d307
commit 78bb2541b3
8 changed files with 3 additions and 42 deletions

View file

@ -44,6 +44,9 @@ extern "C++" {
${decls}
} // extern "C++"
#undef GetCurrentTime // Use GetTickCount() instead.
#endif // enabled
#if defined(__GNUC__) || defined(__clang__)

View file

@ -6,9 +6,6 @@
#ifdef XP_WIN
# include "objbase.h"
// Some Windows header defines this, so undef it as it conflicts with our
// function of the same name.
# undef GetCurrentTime
#endif
#include "mozilla/dom/HTMLMediaElement.h"

View file

@ -42,13 +42,6 @@ using namespace mozilla::media;
namespace mozilla {
// GetCurrentTime is defined in winbase.h as zero argument macro forwarding to
// GetTickCount() and conflicts with MediaDecoder::GetCurrentTime
// implementation.
#ifdef GetCurrentTime
# undef GetCurrentTime
#endif
// avoid redefined macro in unified build
#undef LOG
#undef DUMP

View file

@ -52,13 +52,6 @@ struct SharedDummyStream;
enum class Visibility : uint8_t;
// GetCurrentTime is defined in winbase.h as zero argument macro forwarding to
// GetTickCount() and conflicts with MediaDecoder::GetCurrentTime
// implementation.
# ifdef GetCurrentTime
# undef GetCurrentTime
# endif
struct MOZ_STACK_CLASS MediaDecoderInit {
MediaDecoderOwner* const mOwner;
const double mVolume;

View file

@ -88,12 +88,6 @@
# include <tchar.h>
#endif
// GetCurrentTime is defined in winbase.h as zero argument macro forwarding to
// GetTickCount() and conflicts with MediaStream::GetCurrentTime.
#ifdef GetCurrentTime
# undef GetCurrentTime
#endif
// XXX Workaround for bug 986974 to maintain the existing broken semantics
template <>
struct nsIMediaDevice::COMTypeInfo<mozilla::MediaDevice, void> {

View file

@ -258,12 +258,6 @@ struct TrackBound {
* to handle this.
*/
// GetCurrentTime is defined in winbase.h as zero argument macro forwarding to
// GetTickCount() and conflicts with MediaStream::GetCurrentTime.
#ifdef GetCurrentTime
# undef GetCurrentTime
#endif
class MediaStream : public mozilla::LinkedListElement<MediaStream> {
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaStream)

View file

@ -23,13 +23,6 @@
#include <time.h>
#include "TimeUnits.h"
// GetCurrentTime is defined in winbase.h as zero argument macro forwarding to
// GetTickCount() and conflicts with MediaDecoder::GetCurrentTime
// implementation.
#ifdef GetCurrentTime
# undef GetCurrentTime
#endif
struct JSContext;
class JSObject;

View file

@ -10,12 +10,6 @@
#include "mozilla/TimeStamp.h"
#include "mozilla/TypeTraits.h"
// GetCurrentTime is defined in winbase.h as zero argument macro forwarding to
// GetTickCount().
#ifdef GetCurrentTime
# undef GetCurrentTime
#endif
namespace mozilla {
// Utility class that converts time values represented as an unsigned integral