The patch was generated with `git format-patch` and then the extension was modified to .txt as described here: https://www.mingw-w64.org/contribute/
Hopefully this is vaguely close to the expected format. Please see attached. -- Dustin Gadal
From 3c7096c32ce5caa08152eb44762e2357a3d7e47c Mon Sep 17 00:00:00 2001 From: Dustin Gadal <[email protected]> Date: Fri, 23 Jun 2023 17:16:02 -0700 Subject: [PATCH] Reimplement propkeydef.h and rpcsal.h. The new versions are licensed more permissively than their predecessors. Signed-off-by: Dustin Gadal <[email protected]> --- mingw-w64-headers/include/propkeydef.h | 98 ++++++-------- mingw-w64-headers/include/rpcsal.h | 177 +++++++++++++------------ 2 files changed, 133 insertions(+), 142 deletions(-) diff --git a/mingw-w64-headers/include/propkeydef.h b/mingw-w64-headers/include/propkeydef.h index 1f276471b..41efb9fc8 100644 --- a/mingw-w64-headers/include/propkeydef.h +++ b/mingw-w64-headers/include/propkeydef.h @@ -1,73 +1,63 @@ -/* - * Copyright (C) 2009 Maarten Lankhorst - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the mingw-w64 runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. */ -#ifndef PID_FIRST_USABLE -#define PID_FIRST_USABLE 2 -#endif -#ifndef REFPROPERTYKEY -#ifdef __cplusplus -#define REFPROPERTYKEY const PROPERTYKEY & -#else /*!__cplusplus*/ -#define REFPROPERTYKEY const PROPERTYKEY * __MIDL_CONST -#endif +#ifndef PROPKEYDEF_H +#define PROPKEYDEF_H + + +// This file provides macros and procedures relevant to the PROPERTYKEY structure defined in wtypes.h. + + +// Property identifiers passed to the DEFINE_PROPERTYKEY macro below should be greater than 1; IDs 0 and 1 are reserved. +// See also: +// https://web.archive.org/web/20221119001250/https://learn.microsoft.com/en-us/windows/win32/api/wtypes/ns-wtypes-propertykey +#if !defined(PID_FIRST_USABLE) +#define PID_FIRST_USABLE 2 #endif +// See the definitions of PROPERTYKEY in wtypes.h, and GUID in guiddef.h. "l" is short for "long", "w" for "word", "b" for "byte", and "pid" for "property identifier". +#if defined(DEFINE_PROPERTYKEY) #undef DEFINE_PROPERTYKEY - -#ifdef INITGUID -#ifdef __cplusplus -#define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) \ - EXTERN_C const PROPERTYKEY DECLSPEC_SELECTANY name = \ - { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }, pid } -#else -#define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) \ - const PROPERTYKEY DECLSPEC_SELECTANY name = \ - { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }, pid } #endif +#if defined(INITGUID) && defined(__cplusplus) +#define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) EXTERN_C const PROPERTYKEY DECLSPEC_SELECTANY name = {{l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}},pid} +#elif defined(INITGUID) && !defined(__cplusplus) +#define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) const PROPERTYKEY DECLSPEC_SELECTANY name = {{l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}},pid} #else -#define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) \ - EXTERN_C const PROPERTYKEY name +#define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) EXTERN_C const PROPERTYKEY name #endif -#ifndef IsEqualPropertyKey -#ifdef __cplusplus -#define IsEqualPropertyKey(a,b) (((a).pid == (b).pid) && IsEqualIID((a).fmtid,(b).fmtid)) -#else -#define IsEqualPropertyKey(a,b) (((a).pid == (b).pid) && IsEqualIID(&(a).fmtid,&(b).fmtid)) + + +// This implementation differs from the Windows SDK in order to correctly match the type of REFGUID used in `IsEqualIID()` (defined in guiddef.h) when __cplusplus is not defined. +#if !defined(IsEqualPropertyKey) && defined(__cplusplus) +#define IsEqualPropertyKey(a, b) (((a).pid == (b).pid) && IsEqualIID( (a).fmtid, (b).fmtid)) +#elif !defined(IsEqualPropertyKey) && !defined(__cplusplus) +#define IsEqualPropertyKey(a, b) (((a).pid == (b).pid) && IsEqualIID(&(a).fmtid, &(b).fmtid)) #endif + + + +#if !defined(REFPROPERTYKEY) && defined(__cplusplus) +#define REFPROPERTYKEY const PROPERTYKEY & +#elif !defined(REFPROPERTYKEY) && !defined(__cplusplus) +#define REFPROPERTYKEY const PROPERTYKEY * __MIDL_CONST #endif -#ifndef _PROPERTYKEY_EQUALITY_OPERATORS_ +#if !defined(_PROPERTYKEY_EQUALITY_OPERATORS_) #define _PROPERTYKEY_EQUALITY_OPERATORS_ -#ifdef __cplusplus +#if defined(__cplusplus) extern "C++" { - -inline bool operator==(REFPROPERTYKEY guidOne, REFPROPERTYKEY guidOther) -{ - return IsEqualPropertyKey(guidOne, guidOther); -} -inline bool operator!=(REFPROPERTYKEY guidOne, REFPROPERTYKEY guidOther) -{ - return !(guidOne == guidOther); -} - + inline bool operator == (REFPROPERTYKEY k0, REFPROPERTYKEY k1) { return IsEqualPropertyKey(k0, k1); } + inline bool operator != (REFPROPERTYKEY k0, REFPROPERTYKEY k1) { return !IsEqualPropertyKey(k0, k1); } } #endif #endif + + +#endif // PROPKEYDEF_H diff --git a/mingw-w64-headers/include/rpcsal.h b/mingw-w64-headers/include/rpcsal.h index 72a61ef29..cea7c6cd5 100644 --- a/mingw-w64-headers/include/rpcsal.h +++ b/mingw-w64-headers/include/rpcsal.h @@ -1,170 +1,171 @@ -/* - * Copyright (C) 2011 Francois Gouget - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the mingw-w64 runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. */ +#ifndef RPCSAL_H +#define RPCSAL_H -#ifndef __RPCSAL_H_VERSION__ -# define __RPCSAL_H_VERSION__ 100 + +// The macros listed in this file were intended for annotating the APIs for +// remote procedure calls. They have fallen into disuse, and so are simply +// defined below as the empty string. Arguably, this file should simply +// be left empty, along with specstrings.h, rpcndr.h, sal.h, etc. + + +#include <specstrings.h> + + + +#if !defined(__RPCSAL_H_VERSION__) +#define __RPCSAL_H_VERSION__ 100 +#endif + +#if !defined(_SAL1_2_Source_) +#define _SAL1_2_Source_(Name, args, annotes) #endif #define __RPC__deref_in -#define __RPC__deref_in_opt -#define __RPC__deref_in_string -#define __RPC__deref_in_opt_string #define __RPC__deref_in_ecount(size) -#define __RPC__deref_in_ecount_opt(size) -#define __RPC__deref_in_ecount_opt_string(size) #define __RPC__deref_in_ecount_full(size) #define __RPC__deref_in_ecount_full_opt(size) -#define __RPC__deref_in_ecount_full_string(size) #define __RPC__deref_in_ecount_full_opt_string(size) +#define __RPC__deref_in_ecount_full_string(size) +#define __RPC__deref_in_ecount_opt(size) +#define __RPC__deref_in_ecount_opt_string(size) #define __RPC__deref_in_ecount_part(size, length) #define __RPC__deref_in_ecount_part_opt(size, length) +#define __RPC__deref_in_opt +#define __RPC__deref_in_opt_string +#define __RPC__deref_in_string #define __RPC__deref_in_xcount(size) -#define __RPC__deref_in_xcount_opt(size) -#define __RPC__deref_in_xcount_opt_string(size) #define __RPC__deref_in_xcount_full(size) #define __RPC__deref_in_xcount_full_opt(size) -#define __RPC__deref_in_xcount_full_string(size) #define __RPC__deref_in_xcount_full_opt_string(size) +#define __RPC__deref_in_xcount_full_string(size) +#define __RPC__deref_in_xcount_opt(size) +#define __RPC__deref_in_xcount_opt_string(size) #define __RPC__deref_in_xcount_part(size, length) #define __RPC__deref_in_xcount_part_opt(size, length) - #define __RPC__deref_inout -#define __RPC__deref_inout_opt -#define __RPC__deref_inout_string -#define __RPC__deref_inout_opt_string -#define __RPC__deref_inout_ecount_opt(size) #define __RPC__deref_inout_ecount_full(size) #define __RPC__deref_inout_ecount_full_opt(size) -#define __RPC__deref_inout_ecount_full_string(size) #define __RPC__deref_inout_ecount_full_opt_string(size) +#define __RPC__deref_inout_ecount_full_string(size) +#define __RPC__deref_inout_ecount_opt(size) #define __RPC__deref_inout_ecount_part_opt(size, length) -#define __RPC__deref_inout_xcount_opt(size) +#define __RPC__deref_inout_opt +#define __RPC__deref_inout_opt_string +#define __RPC__deref_inout_string #define __RPC__deref_inout_xcount_full(size) #define __RPC__deref_inout_xcount_full_opt(size) -#define __RPC__deref_inout_xcount_full_string(size) #define __RPC__deref_inout_xcount_full_opt_string(size) +#define __RPC__deref_inout_xcount_full_string(size) +#define __RPC__deref_inout_xcount_opt(size) #define __RPC__deref_inout_xcount_part_opt(size, length) - -#define __RPC__deref_out -#define __RPC__deref_out_opt -#define __RPC__deref_out_string -#define __RPC__deref_out_opt_string -#define __RPC__deref_out_ecount(size) -#define __RPC__deref_out_ecount_opt(size) -#define __RPC__deref_out_ecount_full(size) -#define __RPC__deref_out_ecount_full_opt(size) -#define __RPC__deref_out_ecount_full_string(size) -#define __RPC__deref_out_ecount_full_opt_string(size) -#define __RPC__deref_out_ecount_part(size, length) -#define __RPC__deref_out_ecount_part_opt(size, length) -#define __RPC__deref_out_xcount(size) -#define __RPC__deref_out_xcount_opt(size) -#define __RPC__deref_out_xcount_full(size) -#define __RPC__deref_out_xcount_full_opt(size) -#define __RPC__deref_out_xcount_full_string(size) -#define __RPC__deref_out_xcount_full_opt_string(size) -#define __RPC__deref_out_xcount_part(size, length) -#define __RPC__deref_out_xcount_part_opt(size, length) - #define __RPC__deref_opt_in #define __RPC__deref_opt_in_opt -#define __RPC__deref_opt_in_string #define __RPC__deref_opt_in_opt_string - +#define __RPC__deref_opt_in_string #define __RPC__deref_opt_inout -#define __RPC__deref_opt_inout_opt -#define __RPC__deref_opt_inout_string -#define __RPC__deref_opt_inout_opt_string #define __RPC__deref_opt_inout_ecount(size) -#define __RPC__deref_opt_inout_ecount_opt(size) #define __RPC__deref_opt_inout_ecount_full(size) #define __RPC__deref_opt_inout_ecount_full_opt(size) -#define __RPC__deref_opt_inout_ecount_full_string(size) #define __RPC__deref_opt_inout_ecount_full_opt_string(size) +#define __RPC__deref_opt_inout_ecount_full_string(size) +#define __RPC__deref_opt_inout_ecount_opt(size) #define __RPC__deref_opt_inout_ecount_part(size, length) #define __RPC__deref_opt_inout_ecount_part_opt(size, length) -#define __RPC__deref_opt_inout_xcount(size) -#define __RPC__deref_opt_inout_xcount_opt(size) +#define __RPC__deref_opt_inout_opt +#define __RPC__deref_opt_inout_opt_string +#define __RPC__deref_opt_inout_string #define __RPC__deref_opt_inout_xcount_full(size) #define __RPC__deref_opt_inout_xcount_full_opt(size) -#define __RPC__deref_opt_inout_xcount_full_string(size) #define __RPC__deref_opt_inout_xcount_full_opt_string(size) +#define __RPC__deref_opt_inout_xcount_full_string(size) +#define __RPC__deref_opt_inout_xcount_opt(size) #define __RPC__deref_opt_inout_xcount_part(size, length) #define __RPC__deref_opt_inout_xcount_part_opt(size, length) - +#define __RPC__deref_out +#define __RPC__deref_out_ecount(size) +#define __RPC__deref_out_ecount_full(size) +#define __RPC__deref_out_ecount_full_opt(size) +#define __RPC__deref_out_ecount_full_opt_string(size) +#define __RPC__deref_out_ecount_full_string(size) +#define __RPC__deref_out_ecount_opt(size) +#define __RPC__deref_out_ecount_part(size, length) +#define __RPC__deref_out_ecount_part_opt(size, length) +#define __RPC__deref_out_opt +#define __RPC__deref_out_opt_string +#define __RPC__deref_out_string +#define __RPC__deref_out_xcount(size) +#define __RPC__deref_out_xcount_full(size) +#define __RPC__deref_out_xcount_full_opt(size) +#define __RPC__deref_out_xcount_full_opt_string(size) +#define __RPC__deref_out_xcount_full_string(size) +#define __RPC__deref_out_xcount_opt(size) +#define __RPC__deref_out_xcount_part(size, length) +#define __RPC__deref_out_xcount_part_opt(size, length) #define __RPC__in -#define __RPC__in_opt -#define __RPC__in_string -#define __RPC__in_opt_string #define __RPC__in_ecount(size) -#define __RPC__in_ecount_opt(size) #define __RPC__in_ecount_full(size) #define __RPC__in_ecount_full_opt(size) -#define __RPC__in_ecount_full_string(size) #define __RPC__in_ecount_full_opt_string(size) +#define __RPC__in_ecount_full_string(size) +#define __RPC__in_ecount_opt(size) +#define __RPC__in_ecount_opt_string(size) #define __RPC__in_ecount_part(size, length) #define __RPC__in_ecount_part_opt(size, length) +#define __RPC__in_opt +#define __RPC__in_opt_string +#define __RPC__in_range(min,max) +#define __RPC__in_string #define __RPC__in_xcount(size) -#define __RPC__in_xcount_opt(size) #define __RPC__in_xcount_full(size) #define __RPC__in_xcount_full_opt(size) -#define __RPC__in_xcount_full_string(size) #define __RPC__in_xcount_full_opt_string(size) +#define __RPC__in_xcount_full_string(size) +#define __RPC__in_xcount_opt(size) +#define __RPC__in_xcount_opt_string(size) #define __RPC__in_xcount_part(size, length) #define __RPC__in_xcount_part_opt(size, length) - #define __RPC__inout -#define __RPC__inout_opt -#define __RPC__inout_string -#define __RPC__inout_opt_string -#define __RPC__opt_inout #define __RPC__inout_ecount(size) -#define __RPC__inout_ecount_opt(size) #define __RPC__inout_ecount_full(size) #define __RPC__inout_ecount_full_opt(size) -#define __RPC__inout_ecount_full_string(size) #define __RPC__inout_ecount_full_opt_string(size) +#define __RPC__inout_ecount_full_string(size) +#define __RPC__inout_ecount_opt(size) #define __RPC__inout_ecount_part(size, length) #define __RPC__inout_ecount_part_opt(size, length) +#define __RPC__inout_opt +#define __RPC__inout_opt_string +#define __RPC__inout_string #define __RPC__inout_xcount(size) -#define __RPC__inout_xcount_opt(size) #define __RPC__inout_xcount_full(size) #define __RPC__inout_xcount_full_opt(size) -#define __RPC__inout_xcount_full_string(size) #define __RPC__inout_xcount_full_opt_string(size) +#define __RPC__inout_xcount_full_string(size) +#define __RPC__inout_xcount_opt(size) #define __RPC__inout_xcount_part(size, length) #define __RPC__inout_xcount_part_opt(size, length) - #define __RPC__out #define __RPC__out_ecount(size) #define __RPC__out_ecount_full(size) #define __RPC__out_ecount_full_string(size) #define __RPC__out_ecount_part(size, length) +#define __RPC__out_ecount_string(size) #define __RPC__out_xcount(size) #define __RPC__out_xcount_full(size) #define __RPC__out_xcount_full_string(size) #define __RPC__out_xcount_part(size, length) - +#define __RPC__out_xcount_string(size) +#define __RPC__range(min,max) #define __RPC_full_pointer #define __RPC_ref_pointer #define __RPC_string #define __RPC_unique_pointer -#define __RPC__range(min,max) -#define __RPC__in_range(min,max) + +#endif // RPCSAL_H -- 2.35.1.windows.2
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
