0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

win32: replace libuuid.a usage with initguid.h

Including initguid.h at the top of a file that uses references to GUIDs
causes the GUIDs to be declared globally with __declspec(selectany). The
'selectany' attribute tells the linker to consolidate multiple
definitions of each GUID, which would be great except that, in Cygwin
and MinGW GCC 6.1, this method of linking makes the GUIDs conflict with
the ones declared in libuuid.a.

Since initguid.h obsoletes libuuid.a in modern compilers that support
__declspec(selectany), add initguid.h to all files that use GUIDs and
remove libuuid.a from the build.

Fixes #3097
This commit is contained in:
James Ross-Gowan 2016-05-01 01:49:38 +10:00
parent 9fda504d18
commit 622bcb0e37
6 changed files with 7 additions and 2 deletions

View File

@ -17,6 +17,7 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
#include <initguid.h>
#include <wchar.h>
#include "ao_wasapi.h"

View File

@ -15,6 +15,7 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
#include <initguid.h>
#include <libavcodec/d3d11va.h>
#include "lavc.h"

View File

@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <initguid.h>
#define DXVA2API_USE_BITFIELDS
#include <libavcodec/dxva2.h>

View File

@ -15,6 +15,7 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
#include <initguid.h>
#include <assert.h>
#include <windows.h>
#include <d3d11.h>

View File

@ -15,13 +15,13 @@
* with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
#include <initguid.h>
#include <stdio.h>
#include <limits.h>
#include <pthread.h>
#include <assert.h>
#include <windows.h>
#include <windowsx.h>
#include <initguid.h>
#include <ole2.h>
#include <shobjidl.h>
#include <avrt.h>

View File

@ -140,7 +140,7 @@ main_dependencies = [
'name': 'win32',
'desc': 'win32',
'deps_any': [ 'os-win32', 'os-cygwin' ],
'func': check_cc(lib=['winmm', 'gdi32', 'ole32', 'uuid', 'avrt', 'dwmapi']),
'func': check_cc(lib=['winmm', 'gdi32', 'ole32', 'avrt', 'dwmapi']),
}, {
'name': '--win32-internal-pthreads',
'desc': 'internal pthread wrapper for win32 (Vista+)',