aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-extended/upx/upx/0001-MyCom.h-fix-build-with-gcc-11.patch
blob: 8b07c77ed43bd0d44502722d44dd369f7dfa761a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From 8fe8cd22163fe11b791aac15b642d122ea98b9b5 Mon Sep 17 00:00:00 2001
From: Martin Jansa <martin.jansa@lge.com>
Date: Fri, 14 May 2021 02:26:13 -0700
Subject: [PATCH] MyCom.h: fix build with gcc-11

* fixes:
  ./../src/lzma-sdk/C/7zip/Compress/LZMA/LZMAEncoder.h: In member function 'virtual ULONG NCompress::NLZMA::CEncoder::Release()':
  ./../src/lzma-sdk/C/7zip/Compress/LZMA/../../../Common/MyCom.h:159:32: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
    159 | STDMETHOD_(ULONG, Release)() { if (--__m_RefCount != 0)  \
        |                                ^~

Upstream-Status: Submitted [https://github.com/upx/upx-lzma-sdk/pull/5]
Signed-off-by: Martin Jansa <martin.jansa@lge.com>
---
 C/Common/MyCom.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/C/Common/MyCom.h b/C/Common/MyCom.h
index b8dbf38..2e3c54a 100644
--- a/C/Common/MyCom.h
+++ b/C/Common/MyCom.h
@@ -156,8 +156,7 @@ public:
 
 #define MY_ADDREF_RELEASE \
 STDMETHOD_(ULONG, AddRef)() { return ++__m_RefCount; } \
-STDMETHOD_(ULONG, Release)() { if (--__m_RefCount != 0)  \
-  return __m_RefCount; delete this; return 0; }
+STDMETHOD_(ULONG, Release)() { if (--__m_RefCount != 0) return __m_RefCount; delete this; return 0; }
 
 #define MY_UNKNOWN_IMP_SPEC(i) \
   MY_QUERYINTERFACE_BEGIN \