Commit f4bbcce1 authored by Ghislain MARY's avatar Ghislain MARY

Correct handling of WINAPI families.

parent 8dae6e32
......@@ -433,10 +433,10 @@ int ms_factory_load_plugins(MSFactory *factory, const char *dir){
snprintf(szDirPath, sizeof(szDirPath), "%s", dir);
// Start searching for .dll files in the current directory.
#ifdef WINAPI_FAMILY_PHONE_APP
snprintf(szDirPath, sizeof(szDirPath), "%s\\libms*.dll", dir);
#else
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
snprintf(szDirPath, sizeof(szDirPath), "%s\\*.dll", dir);
#else
snprintf(szDirPath, sizeof(szDirPath), "%s\\libms*.dll", dir);
#endif
#ifdef UNICODE
mbstowcs(wszDirPath, szDirPath, sizeof(wszDirPath));
......@@ -454,7 +454,7 @@ int ms_factory_load_plugins(MSFactory *factory, const char *dir){
while (!fFinished)
{
/* load library */
#ifndef WINAPI_FAMILY_PHONE_APP
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
UINT em=0;
#endif
HINSTANCE os_handle;
......@@ -467,9 +467,7 @@ int ms_factory_load_plugins(MSFactory *factory, const char *dir){
#else
snprintf(szPluginFile, sizeof(szPluginFile), "%s\\%s", szDirPath, FileData.cFileName);
#endif
#ifdef WINAPI_FAMILY_PHONE_APP
os_handle = LoadPackagedLibrary(wszPluginFile, 0);
#else
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
if (!debug) em = SetErrorMode (SEM_FAILCRITICALERRORS);
#ifdef UNICODE
......@@ -487,6 +485,8 @@ int ms_factory_load_plugins(MSFactory *factory, const char *dir){
#endif
}
if (!debug) SetErrorMode (em);
#else
os_handle = LoadPackagedLibrary(wszPluginFile, 0);
#endif
if (os_handle==NULL)
ms_error("Fail to load plugin %s: error %i", szPluginFile, (int)GetLastError());
......
......@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define IPV4_HEADER_SIZE 20
#define IPV6_HEADER_SIZE 40
#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(WINAPI_FAMILY_PHONE_APP)
#if defined(WIN32) && !defined(_WIN32_WCE) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
HINSTANCE m_IcmpInst = NULL;
......
......@@ -177,7 +177,7 @@ mblk_t *ms_load_jpeg_as_yuv(const char *jpgpath, MSVideoSize *reqsize){
uint8_t *jpgbuf;
DWORD err;
HANDLE fd;
#if defined(UNICODE) && defined(WINAPI_FAMILY_PHONE_APP)
#if defined(UNICODE) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
WCHAR wUnicode[1024];
MultiByteToWideChar(CP_UTF8, 0, jpgpath, -1, wUnicode, 1024);
fd = CreateFile2(wUnicode, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, NULL);
......@@ -191,7 +191,7 @@ mblk_t *ms_load_jpeg_as_yuv(const char *jpgpath, MSVideoSize *reqsize){
}
st_sizel=0;
st_sizeh=0;
#if defined(UNICODE) && defined(WINAPI_FAMILY_PHONE_APP)
#if defined(UNICODE) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
{
WIN32_FILE_ATTRIBUTE_DATA attr_data;
GetFileAttributesEx(wUnicode, GetFileExInfoStandard, &attr_data);
......
......@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "private.h"
#ifdef ORTP_HAVE_SRTP
#if defined(ANDROID) || defined(WINAPI_FAMILY_PHONE_APP)
#if defined(ANDROID) || (defined(WIN32) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP))
// Android and Windows phone don't use make install
#include <srtp_priv.h>
#else
......
......@@ -70,7 +70,7 @@ extern MSSndCardDesc oss_card_desc;
extern MSSndCardDesc arts_card_desc;
#endif
#if defined(WIN32) && !WINAPI_FAMILY_APP
#if defined(WIN32) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
extern MSSndCardDesc winsnd_card_desc;
#endif
......@@ -129,7 +129,7 @@ static MSSndCardDesc * ms_snd_card_descs[]={
&arts_card_desc,
#endif
#if defined(WIN32) && !WINAPI_FAMILY_APP
#if defined(WIN32) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
&winsnd_card_desc,
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment