Fixed default visibility.

When nothing is declared, only export symbols defined
with WINPR_API or FREERDP_API defined.
Override this setting if BUILD_TESTING to allow tests
access to internal functions usually not exposed.
This commit is contained in:
Armin Novak 2016-02-26 19:25:49 +01:00
parent 9d21117836
commit 1036f1e296
9 changed files with 25 additions and 23 deletions

View File

@ -122,8 +122,10 @@ if(NOT DEFINED BUILD_SHARED_LIBS)
endif() endif()
endif() endif()
if(NOT DEFINED EXPORT_ALL_SYMBOLS) if(BUILD_TESTING)
set(EXPORT_ALL_SYMBOLS TRUE) set(EXPORT_ALL_SYMBOLS TRUE)
elseif(NOT DEFINED EXPORT_ALL_SYMBOLS)
set(EXPORT_ALL_SYMBOLS FALSE)
endif() endif()
# BSD # BSD

View File

@ -398,7 +398,7 @@ BOOL freerdp_shall_disconnect(freerdp* instance)
return TRUE; return TRUE;
} }
FREERDP_API BOOL freerdp_focus_required(freerdp* instance) BOOL freerdp_focus_required(freerdp* instance)
{ {
rdpRdp* rdp; rdpRdp* rdp;
BOOL bRetCode = FALSE; BOOL bRetCode = FALSE;
@ -778,19 +778,19 @@ void freerdp_free(freerdp* instance)
free(instance); free(instance);
} }
FREERDP_API ULONG freerdp_get_transport_sent(rdpContext* context, BOOL resetCount) { ULONG freerdp_get_transport_sent(rdpContext* context, BOOL resetCount) {
ULONG written = context->rdp->transport->written; ULONG written = context->rdp->transport->written;
if (resetCount) if (resetCount)
context->rdp->transport->written = 0; context->rdp->transport->written = 0;
return written; return written;
} }
FREERDP_API HANDLE getChannelErrorEventHandle(rdpContext* context) HANDLE getChannelErrorEventHandle(rdpContext* context)
{ {
return context->channelErrorEvent; return context->channelErrorEvent;
} }
FREERDP_API BOOL checkChannelErrorEvent(rdpContext* context) BOOL checkChannelErrorEvent(rdpContext* context)
{ {
if (WaitForSingleObject( context->channelErrorEvent, 0) == WAIT_OBJECT_0) if (WaitForSingleObject( context->channelErrorEvent, 0) == WAIT_OBJECT_0)
{ {
@ -805,24 +805,24 @@ FREERDP_API BOOL checkChannelErrorEvent(rdpContext* context)
* *
* @return 0 on success, otherwise a Win32 error code * @return 0 on success, otherwise a Win32 error code
*/ */
FREERDP_API UINT getChannelError(rdpContext* context) UINT getChannelError(rdpContext* context)
{ {
return context->channelErrorNum; return context->channelErrorNum;
} }
FREERDP_API const char* getChannelErrorDescription(rdpContext* context) const char* getChannelErrorDescription(rdpContext* context)
{ {
return context->errorDescription; return context->errorDescription;
} }
FREERDP_API void clearChannelError(rdpContext* context) void clearChannelError(rdpContext* context)
{ {
context->channelErrorNum = 0; context->channelErrorNum = 0;
memset(context->errorDescription, 0, 500); memset(context->errorDescription, 0, 500);
ResetEvent(context->channelErrorEvent); ResetEvent(context->channelErrorEvent);
} }
FREERDP_API void setChannelError(rdpContext* context, UINT errorNum, char* description) void setChannelError(rdpContext* context, UINT errorNum, char* description)
{ {
context->channelErrorNum = errorNum; context->channelErrorNum = errorNum;
strncpy(context->errorDescription, description, 499); strncpy(context->errorDescription, description, 499);

View File

@ -334,7 +334,7 @@ char* crypto_cert_subject_common_name(X509* xcert, int* length)
return (char*) common_name; return (char*) common_name;
} }
FREERDP_API void crypto_cert_subject_alt_name_free(int count, int *lengths, void crypto_cert_subject_alt_name_free(int count, int *lengths,
char** alt_name) char** alt_name)
{ {
int i; int i;

View File

@ -660,7 +660,7 @@ macShadowSubsystem* mac_shadow_subsystem_new()
return subsystem; return subsystem;
} }
int Mac_ShadowSubsystemEntry(RDP_SHADOW_ENTRY_POINTS* pEntryPoints) FREERDP_API int Mac_ShadowSubsystemEntry(RDP_SHADOW_ENTRY_POINTS* pEntryPoints)
{ {
pEntryPoints->New = (pfnShadowSubsystemNew) mac_shadow_subsystem_new; pEntryPoints->New = (pfnShadowSubsystemNew) mac_shadow_subsystem_new;
pEntryPoints->Free = (pfnShadowSubsystemFree) mac_shadow_subsystem_free; pEntryPoints->Free = (pfnShadowSubsystemFree) mac_shadow_subsystem_free;

View File

@ -519,7 +519,7 @@ winShadowSubsystem* win_shadow_subsystem_new()
return subsystem; return subsystem;
} }
int Win_ShadowSubsystemEntry(RDP_SHADOW_ENTRY_POINTS* pEntryPoints) FREERDP_API int Win_ShadowSubsystemEntry(RDP_SHADOW_ENTRY_POINTS* pEntryPoints)
{ {
pEntryPoints->New = (pfnShadowSubsystemNew) win_shadow_subsystem_new; pEntryPoints->New = (pfnShadowSubsystemNew) win_shadow_subsystem_new;
pEntryPoints->Free = (pfnShadowSubsystemFree) win_shadow_subsystem_free; pEntryPoints->Free = (pfnShadowSubsystemFree) win_shadow_subsystem_free;

View File

@ -1437,7 +1437,7 @@ void x11_shadow_subsystem_free(x11ShadowSubsystem* subsystem)
free(subsystem); free(subsystem);
} }
int X11_ShadowSubsystemEntry(RDP_SHADOW_ENTRY_POINTS* pEntryPoints) FREERDP_API int X11_ShadowSubsystemEntry(RDP_SHADOW_ENTRY_POINTS* pEntryPoints)
{ {
pEntryPoints->New = (pfnShadowSubsystemNew) x11_shadow_subsystem_new; pEntryPoints->New = (pfnShadowSubsystemNew) x11_shadow_subsystem_new;
pEntryPoints->Free = (pfnShadowSubsystemFree) x11_shadow_subsystem_free; pEntryPoints->Free = (pfnShadowSubsystemFree) x11_shadow_subsystem_free;

View File

@ -523,37 +523,37 @@ static const _SERIAL_IOCTL_NAME _SERIAL_IOCTL_NAMES[] =
/** /**
* FIXME: got a proper function name and place * FIXME: got a proper function name and place
*/ */
const char* _comm_serial_ioctl_name(ULONG number); WINPR_API const char* _comm_serial_ioctl_name(ULONG number);
/** /**
* FIXME: got a proper function name and place * FIXME: got a proper function name and place
*/ */
void _comm_setServerSerialDriver(HANDLE hComm, SERIAL_DRIVER_ID); WINPR_API void _comm_setServerSerialDriver(HANDLE hComm, SERIAL_DRIVER_ID);
/** /**
* FIXME: got a proper function name and place * FIXME: got a proper function name and place
* *
* permissive mode is disabled by default. * permissive mode is disabled by default.
*/ */
BOOL _comm_set_permissive(HANDLE hDevice, BOOL permissive); WINPR_API BOOL _comm_set_permissive(HANDLE hDevice, BOOL permissive);
/** /**
* FIXME: to be moved in comm_ioctl.h * FIXME: to be moved in comm_ioctl.h
*/ */
BOOL CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, WINPR_API BOOL CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize,
LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped); LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped);
/** /**
* FIXME: to be moved in comm_io.h * FIXME: to be moved in comm_io.h
*/ */
BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, WINPR_API BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead,
LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped); LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped);
/** /**
* FIXME: to be moved in comm_io.h * FIXME: to be moved in comm_io.h
*/ */
BOOL CommWriteFile(HANDLE hDevice, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, WINPR_API BOOL CommWriteFile(HANDLE hDevice, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite,
LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped); LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -500,9 +500,9 @@ WINPR_API PCCERT_CONTEXT CertFindCertificateInStore(HCERTSTORE hCertStore, DWORD
WINPR_API PCCERT_CONTEXT CertEnumCertificatesInStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pPrevCertContext); WINPR_API PCCERT_CONTEXT CertEnumCertificatesInStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pPrevCertContext);
DWORD CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType, WINPR_API DWORD CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType,
DWORD dwFlags, void* pvTypePara, LPWSTR pszNameString, DWORD cchNameString); DWORD dwFlags, void* pvTypePara, LPWSTR pszNameString, DWORD cchNameString);
DWORD CertGetNameStringA(PCCERT_CONTEXT pCertContext, DWORD dwType, WINPR_API DWORD CertGetNameStringA(PCCERT_CONTEXT pCertContext, DWORD dwType,
DWORD dwFlags, void* pvTypePara, LPSTR pszNameString, DWORD cchNameString); DWORD dwFlags, void* pvTypePara, LPSTR pszNameString, DWORD cchNameString);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -22,6 +22,6 @@
#include "wlog.h" #include "wlog.h"
WINPR_API wLogAppender* WLog_BinaryAppender_New(wLog* log); wLogAppender* WLog_BinaryAppender_New(wLog* log);
#endif /* WINPR_WLOG_BINARY_APPENDER_PRIVATE_H */ #endif /* WINPR_WLOG_BINARY_APPENDER_PRIVATE_H */