Skip to content

Commit

Permalink
Merge pull request #21 from cloudwu/master
Browse files Browse the repository at this point in the history
check for strncpy_s
  • Loading branch information
horde3d committed Oct 11, 2013
2 parents 1485897 + 5037e86 commit dcfb485
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,8 @@ ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 2.4)
CONFIGURE_FILE(Horde3D/Source/Horde3DEngine/egExtensions_auto_include.h.in ${CMAKE_BINARY_DIR}/egExtensions_auto_include.h)
CONFIGURE_FILE(Horde3D/Source/Horde3DEngine/egExtensions_auto_install.h.in ${CMAKE_BINARY_DIR}/egExtensions_auto_install.h)

include(CheckFunctionExists)
check_function_exists(strncpy_s HAVE_STRNCPY_S)

add_subdirectory(Horde3D)

5 changes: 4 additions & 1 deletion Horde3D/Source/Shared/utPlatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ typedef unsigned long long uint64;
#undef max
#endif

#if (!defined( _MSC_VER ) || (defined( _MSC_VER ) && (_MSC_VER < 1400))) && !defined( __MINGW32__ )
#if defined( _MSC_VER ) && (_MSC_VER >= 1400) && !defined(HAVE_STRNCPY_S)
# define HAVE_STRNCPY_S
#endif
#if !defined( HAVE_STRNCPY_S )
# define strncpy_s( dst, dstSize, src, count ) strncpy( dst, src, count < dstSize ? count : dstSize )
#endif
#if defined( _MSC_VER ) && (_MSC_VER < 1400)
Expand Down

0 comments on commit dcfb485

Please sign in to comment.