Skip to content

Commit

Permalink
fix: explicitly define REFGUID from ::GUID&, not base::GUID (#30442) (#…
Browse files Browse the repository at this point in the history
…30500)

* fix: explicitly define REFGUID from ::GUID&

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3076480

* fix: duplicate GUID_NULL symbol, add comment
  • Loading branch information
VerteDinde committed Aug 11, 2021
1 parent b6ffa79 commit 2745d70
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion shell/common/gin_converters/guid_converter.h
Expand Up @@ -6,6 +6,17 @@
#define SHELL_COMMON_GIN_CONVERTERS_GUID_CONVERTER_H_

#if defined(OS_WIN)
// c.f.:
// https://chromium-review.googlesource.com/c/chromium/src/+/3076480
// REFGUID is currently incorrectly inheriting its type
// from base::GUID, when it should be inheriting from ::GUID.
// This workaround prevents build errors until the CL is merged
#ifdef _REFGUID_DEFINED
#undef REFGUID
#endif
#define REFGUID const ::GUID&
#define _REFGUID_DEFINED

#include <rpc.h>

#include "base/strings/sys_string_conversions.h"
Expand All @@ -17,7 +28,6 @@

#if defined(OS_WIN)
typedef GUID UUID;
const GUID GUID_NULL = {};
#else
typedef struct {
} UUID;
Expand Down Expand Up @@ -57,6 +67,7 @@ struct Converter<UUID> {
}
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, UUID val) {
#if defined(OS_WIN)
const GUID GUID_NULL = {};
if (val == GUID_NULL) {
return StringToV8(isolate, "");
} else {
Expand Down

0 comments on commit 2745d70

Please sign in to comment.