]> Creatis software - cpPlugins.git/blobdiff - appli/bash/Utility.h.in
Windows compilation 3/3
[cpPlugins.git] / appli / bash / Utility.h.in
index 95c8be0f97292d329922b9bc7b76d6b39f93df04..7dda46f53caf64db1d9591bbc007f0d4cf77ab33 100644 (file)
@@ -6,14 +6,14 @@
 #include <string>
 
 // -------------------------------------------------------------------------
-#define @prj_NAME_OS@
-#ifdef @prj_NAME_OS@
-#  define cpExtensions_STRTOK( A, B, N )  strtok_s(  A, B, N )
-#  define cpExtensions_SPRINTF( B, S, O ) sprintf_s( B, S, "%s", O );
-#else // @prj_NAME_OS@
-#  define cpExtensions_STRTOK( A, B, N )  std::strtok( A, B )
-#  define cpExtensions_SPRINTF( B, S, O ) std::sprintf( B, "%s", O );
-#endif // @prj_NAME_OS@
+#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
@@ -33,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;