amf-headers: Fix some redefinition errors

This commit is contained in:
Biswapriyo Nath
2022-01-27 20:26:31 +05:30
committed by GitHub
parent ab232d6d10
commit 9fab7fffab
2 changed files with 38 additions and 3 deletions

View File

@@ -0,0 +1,26 @@
From d376bd3f4d1e6bd8b6c7d4151caa701b238235ac Mon Sep 17 00:00:00 2001
From: Christopher Degawa <ccom@randomderp.com>
Date: Tue, 14 Dec 2021 12:58:39 -0600
Subject: [PATCH] Platform.h: tie typedef for HRESULT to !windows
The existence of `__clang__` there breaks clang on Windows compilation
due to conflicting LONG vs INT typedefs
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
---
amf/public/include/core/Platform.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/amf/public/include/core/Platform.h b/amf/public/include/core/Platform.h
index 7fa61cc..a175e62 100644
--- a/amf/public/include/core/Platform.h
+++ b/amf/public/include/core/Platform.h
@@ -72,7 +72,7 @@
// #error Need to define AMF_ALIGN
#endif
-#if defined(__linux) || (__clang__)
+#if !defined(_WIN32)
typedef signed int HRESULT;
#define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0)
#define FAILED(hr) (((HRESULT)(hr)) < 0)

View File

@@ -4,14 +4,23 @@ _realname=amf-headers
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.4.23
pkgrel=1
pkgrel=2
pkgdesc='Header files for AMD Advanced Media Framework'
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
url='https://github.com/GPUOpen-LibrariesAndSDKs/AMF/'
license=('MIT')
source=("${_realname}-${pkgver}.tar.gz::https://github.com/GPUOpen-LibrariesAndSDKs/AMF/archive/v${pkgver}.tar.gz")
sha256sums=('7c8a5c91bca54e257258e4efcc61925921f2efe432efd34cf77dd9dc1803c38a')
source=("${_realname}-${pkgver}.tar.gz::https://github.com/GPUOpen-LibrariesAndSDKs/AMF/archive/v${pkgver}.tar.gz"
"0001-prevent-some-redefinition.patch")
sha256sums=('7c8a5c91bca54e257258e4efcc61925921f2efe432efd34cf77dd9dc1803c38a'
'cb81680806a7049bff2b1ac70d46fe925fc91e5ab763db30f7f4f4a8b89daebc')
prepare() {
cd "AMF-${pkgver}"
# https://github.com/GPUOpen-LibrariesAndSDKs/AMF/pull/286
patch -p1 -i "${srcdir}/0001-prevent-some-redefinition.patch"
}
package() {
mkdir -p "${pkgdir}${MINGW_PREFIX}"/include/AMF/