From fb3662c7e265678396a95b6e3a25b2894e5bb8c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Moreau?= Date: Fri, 9 May 2014 22:44:19 -0400 Subject: [PATCH] winpr: fix ranlib missing symbols warnings on OS X --- winpr/include/winpr/locale.h | 10 ++++++++ winpr/libwinpr/com/com.c | 9 +++++++ winpr/libwinpr/handle/CMakeLists.txt | 3 +-- winpr/libwinpr/handle/table.c | 32 ------------------------- winpr/libwinpr/locale/locale.c | 10 ++++++++ winpr/libwinpr/smartcard/CMakeLists.txt | 10 +++++--- winpr/libwinpr/synch/CMakeLists.txt | 1 - winpr/libwinpr/synch/synch.c | 25 ------------------- winpr/libwinpr/timezone/timezone.c | 5 +++- winpr/libwinpr/utils/wlog/TextMessage.c | 4 ++++ 10 files changed, 45 insertions(+), 64 deletions(-) delete mode 100644 winpr/libwinpr/handle/table.c delete mode 100644 winpr/libwinpr/synch/synch.c diff --git a/winpr/include/winpr/locale.h b/winpr/include/winpr/locale.h index b63b421bd..6b7d0de6e 100644 --- a/winpr/include/winpr/locale.h +++ b/winpr/include/winpr/locale.h @@ -483,7 +483,17 @@ extern "C" { #endif +DWORD WINAPI FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, + LPSTR lpBuffer, DWORD nSize, va_list* Arguments); +DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, + LPWSTR lpBuffer, DWORD nSize, va_list* Arguments); + +#ifdef UNICODE +#define FormatMessage FormatMessageW +#else +#define FormatMessage FormatMessageA +#endif #ifdef __cplusplus } diff --git a/winpr/libwinpr/com/com.c b/winpr/libwinpr/com/com.c index 97332a070..367f12b6f 100644 --- a/winpr/libwinpr/com/com.c +++ b/winpr/libwinpr/com/com.c @@ -22,6 +22,7 @@ #endif #include +#include /** * api-ms-win-core-com-l1-1-0.dll: @@ -110,6 +111,14 @@ #ifndef _WIN32 +HRESULT CoInitializeEx(LPVOID pvReserved, DWORD dwCoInit) +{ + return S_OK; +} +void CoUninitialize(void) +{ + +} #endif diff --git a/winpr/libwinpr/handle/CMakeLists.txt b/winpr/libwinpr/handle/CMakeLists.txt index 3dc9dfb0c..93d112bcd 100644 --- a/winpr/libwinpr/handle/CMakeLists.txt +++ b/winpr/libwinpr/handle/CMakeLists.txt @@ -20,8 +20,7 @@ set(MODULE_PREFIX "WINPR_HANDLE") set(${MODULE_PREFIX}_SRCS handle.c - handle.h - table.c) + handle.h) if(MSVC AND (NOT MONOLITHIC_BUILD)) set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) diff --git a/winpr/libwinpr/handle/table.c b/winpr/libwinpr/handle/table.c deleted file mode 100644 index eb81e2b0c..000000000 --- a/winpr/libwinpr/handle/table.c +++ /dev/null @@ -1,32 +0,0 @@ -/** - * WinPR: Windows Portable Runtime - * Handle Management - * - * Copyright 2012 Marc-Andre Moreau - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#ifndef _WIN32 - -#include "../handle/handle.h" - -#endif - diff --git a/winpr/libwinpr/locale/locale.c b/winpr/libwinpr/locale/locale.c index 439401128..177484b1d 100644 --- a/winpr/libwinpr/locale/locale.c +++ b/winpr/libwinpr/locale/locale.c @@ -90,7 +90,17 @@ #ifndef _WIN32 +DWORD WINAPI FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, + LPSTR lpBuffer, DWORD nSize, va_list* Arguments) +{ + return 0; +} +DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, + LPWSTR lpBuffer, DWORD nSize, va_list* Arguments) +{ + return 0; +} #endif diff --git a/winpr/libwinpr/smartcard/CMakeLists.txt b/winpr/libwinpr/smartcard/CMakeLists.txt index 4ff7bfd0e..45eb7c5b3 100644 --- a/winpr/libwinpr/smartcard/CMakeLists.txt +++ b/winpr/libwinpr/smartcard/CMakeLists.txt @@ -27,9 +27,13 @@ set(${MODULE_PREFIX}_SRCS smartcard.h smartcard_link.c smartcard_pcsc.c - smartcard_pcsc.h - smartcard_winscard.c - smartcard_winscard.h) + smartcard_pcsc.h) + +if(WIN32) + list(${MODULE_PREFIX}_SRCS APPEND + smartcard_winscard.c + smartcard_winscard.h) +endif() if(MSVC AND (NOT MONOLITHIC_BUILD)) set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) diff --git a/winpr/libwinpr/synch/CMakeLists.txt b/winpr/libwinpr/synch/CMakeLists.txt index b2f40cc05..66ce56a53 100644 --- a/winpr/libwinpr/synch/CMakeLists.txt +++ b/winpr/libwinpr/synch/CMakeLists.txt @@ -35,7 +35,6 @@ set(${MODULE_PREFIX}_SRCS semaphore.c sleep.c srw.c - synch.c synch.h timer.c wait.c) diff --git a/winpr/libwinpr/synch/synch.c b/winpr/libwinpr/synch/synch.c deleted file mode 100644 index d27a73f85..000000000 --- a/winpr/libwinpr/synch/synch.c +++ /dev/null @@ -1,25 +0,0 @@ -/** - * WinPR: Windows Portable Runtime - * Synchronization Functions - * - * Copyright 2012 Marc-Andre Moreau - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - diff --git a/winpr/libwinpr/timezone/timezone.c b/winpr/libwinpr/timezone/timezone.c index 229dc9f0e..f7af0cebc 100644 --- a/winpr/libwinpr/timezone/timezone.c +++ b/winpr/libwinpr/timezone/timezone.c @@ -41,6 +41,9 @@ #ifndef _WIN32 - +BOOL WINAPI FileTimeToSystemTime(const FILETIME *lpFileTime, LPSYSTEMTIME lpSystemTime) +{ + return FALSE; /* unimplemented */ +} #endif diff --git a/winpr/libwinpr/utils/wlog/TextMessage.c b/winpr/libwinpr/utils/wlog/TextMessage.c index 594a79901..e5f110896 100644 --- a/winpr/libwinpr/utils/wlog/TextMessage.c +++ b/winpr/libwinpr/utils/wlog/TextMessage.c @@ -25,3 +25,7 @@ #include "wlog/TextMessage.h" +void wlog_TextMessage_dummy() +{ + /* avoid no symbol ranlib warning */ +}