fixed few MSVC warnings; fixed missing exports
parent
4da7bb4fec
commit
9d5427bbd4
|
@ -34,6 +34,11 @@ set(SYSTEM_LIBRARIES "")
|
|||
# list of core (static) libraries built in current configuration (used by lib/CMakeLists.txt)
|
||||
set(CORE_LIBRARIES "" CACHE INTERNAL "")
|
||||
|
||||
# make sure related functions are exported in final dll
|
||||
if(WIN32 AND BUILD_SHARED_LIBS)
|
||||
add_definitions(-Dlibnfs_EXPORTS)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
|
||||
add_definitions("-D_U_=" -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
list(APPEND SYSTEM_LIBRARIES ws2_32)
|
||||
|
@ -58,7 +63,7 @@ add_subdirectory(nlm)
|
|||
add_subdirectory(nsm)
|
||||
add_subdirectory(portmap)
|
||||
add_subdirectory(rquota)
|
||||
add_subdirectory(lib)
|
||||
add_subdirectory(lib) # this has to be last (it links all static libs mentioned in CORE_LIBRARIES)
|
||||
|
||||
if(ENABLE_DOCUMENTATION)
|
||||
add_subdirectory(doc)
|
||||
|
|
|
@ -52,7 +52,7 @@ struct nfs_url {
|
|||
char *file;
|
||||
};
|
||||
|
||||
#if defined(WIN32) && defined(nfs_EXPORTS)
|
||||
#if defined(WIN32) && defined(libnfs_EXPORTS)
|
||||
#define EXTERN __declspec( dllexport )
|
||||
#else
|
||||
#ifndef EXTERN
|
||||
|
|
|
@ -83,7 +83,7 @@ struct rpc_context *rpc_init_context(void)
|
|||
}
|
||||
// Add PID to rpc->xid for easier debugging, making sure to cast
|
||||
// pid to 32-bit type to avoid invalid left-shifts.
|
||||
rpc->xid = salt + rpc_current_time() + ((uint32_t)getpid() << 16);
|
||||
rpc->xid = salt + (uint32_t)rpc_current_time() + ((uint32_t)getpid() << 16);
|
||||
salt += 0x01000000;
|
||||
rpc->fd = -1;
|
||||
rpc->tcp_syncnt = RPC_PARAM_UNDEFINED;
|
||||
|
|
|
@ -889,7 +889,7 @@ int
|
|||
nfs_normalize_path(struct nfs_context *nfs, char *path)
|
||||
{
|
||||
char *str;
|
||||
int len;
|
||||
size_t len;
|
||||
|
||||
/* // -> / */
|
||||
while ((str = strstr(path, "//"))) {
|
||||
|
|
|
@ -50,7 +50,7 @@ int win32_inet_pton(int af, const char * src, void * dst)
|
|||
struct sockaddr_in sa;
|
||||
int len = sizeof(SOCKADDR);
|
||||
int ret = -1;
|
||||
int strLen = strlen(src) + 1;
|
||||
size_t strLen = strlen(src) + 1;
|
||||
#ifdef UNICODE
|
||||
wchar_t *srcNonConst = (wchar_t *)malloc(strLen*sizeof(wchar_t));
|
||||
memset(srcNonConst, 0, strLen);
|
||||
|
|
Loading…
Reference in New Issue