X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=appli%2Fbash%2FUtility.h.in;h=7dda46f53caf64db1d9591bbc007f0d4cf77ab33;hb=06ace6bbbd569c3ca466699d4adf3c293a2e2bb4;hp=a0bbb2183900c891250492163dd33bf753248854;hpb=3393941bf8f26babc7b592db434b40c1b747a687;p=cpPlugins.git diff --git a/appli/bash/Utility.h.in b/appli/bash/Utility.h.in index a0bbb21..7dda46f 100644 --- a/appli/bash/Utility.h.in +++ b/appli/bash/Utility.h.in @@ -6,15 +6,14 @@ #include // ------------------------------------------------------------------------- -#ifdef @prj_NAME@_Windows -# define cpExtensions_STRTOK( A, B, N ) strtok_s( A, B, N ) -# define cpExtensions_SPRINTF( B, S, O ) sprintf_s( B, S, "%s", O ); -# define -#else // @prj_NAME@_Windows -# define cpExtensions_STRTOK( A, B, N ) std::strtok( A, B ) -# define cpExtensions_SPRINTF( B, S, O ) std::sprintf( B, "%s", O ); -#endif // @prj_NAME@_Windows - +#define cpPlugins_bash_OS_@CMAKE_SYSTEM_NAME@ +#ifdef cpPlugins_bash_OS_Windows +# define cpPlugins_bash_STRTOK( A, B, N ) strtok_s( A, B, N ) +# define cpPlugins_bash_SPRINTF( B, S, O ) sprintf_s( B, S, "%s", O ); +#else // cpPlugins_bash_OS_Windows +# define cpPlugins_bash_STRTOK( A, B, N ) std::strtok( A, B ) +# define cpPlugins_bash_SPRINTF( B, S, O ) std::sprintf( B, "%s", O ); +#endif // cpPlugins_bash_OS_Windows // ------------------------------------------------------------------------- namespace cpPlugins_bash @@ -34,11 +33,11 @@ namespace cpPlugins_bash buffer[ i ] = str[ i ]; buffer[ ssize ] = '\0'; char* next; - char* it = cpExtensions_STRTOK( buffer, delims.c_str( ), &next ); + char* it = cpPlugins_bash_STRTOK( buffer, delims.c_str( ), &next ); while( it != NULL ) { tokens.push_back( std::string( it ) ); - it = cpExtensions_STRTOK( NULL, delims.c_str( ), &next ); + it = cpPlugins_bash_STRTOK( NULL, delims.c_str( ), &next ); } // elihw delete [] buffer;