Browse Source

chore: [gn] fix link errors relating to static members (#13488)

I'm not 100% sure why this is working in the gyp build, but I was getting link errors with these variables being defined in the headers.
Jeremy Apthorp 6 years ago
parent
commit
6492732631

+ 3 - 0
brightray/browser/win/win32_desktop_notifications/desktop_notification_controller.cc

@@ -39,6 +39,9 @@ HBITMAP CopyBitmap(HBITMAP bitmap) {
   return ret;
 }
 
+const TCHAR DesktopNotificationController::class_name_[] =
+      TEXT("DesktopNotificationController");
+
 HINSTANCE DesktopNotificationController::RegisterWndClasses() {
   // We keep a static `module` variable which serves a dual purpose:
   // 1. Stores the HINSTANCE where the window classes are registered,

+ 1 - 2
brightray/browser/win/win32_desktop_notifications/desktop_notification_controller.h

@@ -76,8 +76,7 @@ class DesktopNotificationController {
   void DestroyToast(ToastInstance& inst);
 
  private:
-  static constexpr const TCHAR class_name_[] =
-      TEXT("DesktopNotificationController");
+  static const TCHAR class_name_[];
 
   HWND hwnd_controller_ = NULL;
   HFONT caption_font_ = NULL, body_font_ = NULL;

+ 3 - 0
brightray/browser/win/win32_desktop_notifications/toast.cc

@@ -183,6 +183,9 @@ static HBITMAP StretchBitmap(HBITMAP bitmap, unsigned width, unsigned height) {
   return result_bitmap;
 }
 
+const TCHAR DesktopNotificationController::Toast::class_name_[] =
+    TEXT("DesktopNotificationToast");
+
 DesktopNotificationController::Toast::Toast(HWND hwnd,
                                             shared_ptr<NotificationData>* data)
     : hwnd_(hwnd), data_(*data) {

+ 1 - 1
brightray/browser/win/win32_desktop_notifications/toast.h

@@ -64,7 +64,7 @@ class DesktopNotificationController::Toast {
   float AnimateStackCollapse();
 
  private:
-  static constexpr const TCHAR class_name_[] = TEXT("DesktopNotificationToast");
+  static const TCHAR class_name_[];
 
   const HWND hwnd_;
   HDC hdc_;