deepin-screen-recorder/Fix-build-failure-with-gcc-10.patch
2021-08-11 14:31:42 +08:00

53 lines
1.3 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From 3f17a452b635bae79ceff14a8a66cdf433fe8626 Mon Sep 17 00:00:00 2001
From: weidong <weidong@uniontech.com>
Date: Wed, 11 Aug 2021 13:57:28 +0800
Subject: [PATCH] Fix build failure with gcc-10
---
src/event_monitor.cpp | 7 ++++++-
src/screen_shot_event.cpp | 4 ++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/event_monitor.cpp b/src/event_monitor.cpp
index 2b72f18..95c4259 100755
--- a/src/event_monitor.cpp
+++ b/src/event_monitor.cpp
@@ -22,14 +22,19 @@
*/
#include "event_monitor.h"
+#include "keydefine.h"
#include <X11/Xlibint.h>
+// gcc 版本大于10时取消min 宏定义
+#if __GNUC__ == 10
+#undef min
+#endif
#include <X11/Xutil.h>
#include <X11/cursorfont.h>
#include <X11/keysymdef.h>
#include <X11/keysym.h>
#include <X11/extensions/XTest.h>
-#include "keydefine.h"
#include <iostream>
+#include <dlfcn.h>
EventMonitor::EventMonitor(QObject *parent) : QThread(parent)
{
diff --git a/src/screen_shot_event.cpp b/src/screen_shot_event.cpp
index 05dfbb5..02e9ab8 100755
--- a/src/screen_shot_event.cpp
+++ b/src/screen_shot_event.cpp
@@ -1,5 +1,9 @@
#include "screen_shot_event.h"
#include <X11/Xlibint.h>
+// gcc 版本大于10时取消min 宏定义
+#if __GNUC__ == 10
+#undef min
+#endif
#include <X11/Xutil.h>
#include <X11/cursorfont.h>
#include <X11/keysymdef.h>
--
2.20.1