Skip to content

Commit

Permalink
Don't use dllexport/dllimport/visibility("default") with winelib
Browse files Browse the repository at this point in the history
All of these are useless, because the set of symbols to export is
determined by the def file and the set of symbols to import is
determined by whatever undefined symbols are left after linking the
object files together. Silence various warnings about these being
ignored.
  • Loading branch information
cwabbott0 committed Jul 5, 2021
1 parent a748b4a commit 8c4c686
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
5 changes: 0 additions & 5 deletions src/d3d9/d3d9_include.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@
#include <stdint.h>
#include <d3d9.h>

//for some reason we need to specify __declspec(dllexport) for MinGW
#if defined(__WINE__)
#define DLLEXPORT __attribute__((visibility("default")))
#else
#define DLLEXPORT
#endif


#include "../util/com/com_guid.h"
Expand Down
4 changes: 1 addition & 3 deletions src/dxgi/dxgi_include.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#pragma once

//for some reason we need to specify __declspec(dllexport) for MinGW
#if defined(__WINE__)
#define DLLEXPORT __attribute__((visibility("default")))
#elif defined(_MSC_VER)
#if defined(_MSC_VER) || defined(__WINE__)
#define DLLEXPORT
#else
#define DLLEXPORT __declspec(dllexport)
Expand Down
11 changes: 11 additions & 0 deletions src/dxvk/dxvk_openvr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
#endif

#ifdef __WINE__

#pragma push_macro("_WIN32")
// don't use dllimport with winelib, it's useless
#undef _WIN32
#endif

#include <openvr/openvr.hpp>

#ifdef __WINE__
#pragma pop_macro("_WIN32")
#endif

using VR_InitInternalProc = vr::IVRSystem* (VR_CALLTYPE *)(vr::EVRInitError*, vr::EVRApplicationType);
using VR_ShutdownInternalProc = void (VR_CALLTYPE *)();
using VR_GetGenericInterfaceProc = void* (VR_CALLTYPE *)(const char*, vr::EVRInitError*);
Expand Down

0 comments on commit 8c4c686

Please sign in to comment.