mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
fixed Win32 build (VS2010)
git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1050 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -21,11 +21,14 @@ SET(INCLUDE_DIRS
|
||||
INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
|
||||
|
||||
ADD_LIBRARY(rtabmap_utilite ${SRC_FILES})
|
||||
IF(WIN32)
|
||||
TARGET_LINK_LIBRARIES(rtabmap_utilite ${PTHREADS_LIBRARY} ${LIBRARIES} "-lpsapi")
|
||||
ELSE(WIN32)
|
||||
TARGET_LINK_LIBRARIES(rtabmap_utilite ${PTHREADS_LIBRARY} ${LIBRARIES})
|
||||
ENDIF(WIN32)
|
||||
IF(MINGW)
|
||||
TARGET_LINK_LIBRARIES(rtabmap_utilite ${PTHREADS_LIBRARY} "-lpsapi")
|
||||
ELSEIF(WIN32)
|
||||
FIND_LIBRARY(PSAPI_LIBRARIES NAMES psapi libpsapi.dll.a libpsapi.a libpsapi.lib )
|
||||
TARGET_LINK_LIBRARIES(rtabmap_utilite ${PSAPI_LIBRARIES})
|
||||
ELSE()
|
||||
TARGET_LINK_LIBRARIES(rtabmap_utilite ${PTHREADS_LIBRARY})
|
||||
ENDIF()
|
||||
|
||||
SET_TARGET_PROPERTIES(
|
||||
rtabmap_utilite
|
||||
|
||||
@@ -258,18 +258,14 @@ std::string uFormatv (const char *fmt, va_list args)
|
||||
va_list argsTmp;
|
||||
|
||||
while (1) {
|
||||
va_copy(argsTmp, args);
|
||||
#if defined(WIN32) && !defined(__MINGW32__)
|
||||
argsTmp = args;
|
||||
#else
|
||||
va_copy(argsTmp, args);
|
||||
#endif
|
||||
|
||||
// Try to vsnprintf into our buffer.
|
||||
int needed;
|
||||
if(argsTmp != 0)
|
||||
{
|
||||
needed = vsnprintf (buf, size, fmt, argsTmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
needed = snprintf (buf, size, "%s", fmt);
|
||||
}
|
||||
int needed = vsnprintf (buf, size, fmt, argsTmp);
|
||||
va_end(argsTmp);
|
||||
// NB. C99 (which modern Linux and OS X follow) says vsnprintf
|
||||
// failure returns the length it would have needed. But older
|
||||
|
||||
Reference in New Issue
Block a user