[ros-diffs] [cfinck] 30654: - Use ISO C++ functions instead of deprecated POSIX-only ones to make scut compilable with both GCC and MSVC - Add a MSVC project file for scut - Start making scut portable and shareable between RosBE-Windows and RosBE-Unix. Anyway, the Unix part is still untested :-P

cfinck at svn.reactos.org cfinck at svn.reactos.org
Wed Nov 21 23:22:39 CET 2007


Author: cfinck
Date: Thu Nov 22 01:22:39 2007
New Revision: 30654

URL: http://svn.reactos.org/svn/reactos?rev=30654&view=rev
Log:
- Use ISO C++ functions instead of deprecated POSIX-only ones to make scut compilable with both GCC and MSVC
- Add a MSVC project file for scut
- Start making scut portable and shareable between RosBE-Windows and RosBE-Unix. Anyway, the Unix part is still untested :-P

Added:
    trunk/tools/RosBE/RosBE-Windows/Tools/scut.vcproj   (with props)
Modified:
    trunk/tools/RosBE/RosBE-Windows/Tools/   (props changed)
    trunk/tools/RosBE/RosBE-Windows/Tools/scut.c

Propchange: trunk/tools/RosBE/RosBE-Windows/Tools/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Thu Nov 22 01:22:39 2007
@@ -1,1 +1,7 @@
 *.exe
+*.sln
+*.ncb
+*.suo
+*.user
+Debug
+Release

Modified: trunk/tools/RosBE/RosBE-Windows/Tools/scut.c
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Tools/scut.c?rev=30654&r1=30653&r2=30654&view=diff
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Tools/scut.c (original)
+++ trunk/tools/RosBE/RosBE-Windows/Tools/scut.c Thu Nov 22 01:22:39 2007
@@ -8,7 +8,8 @@
  *
  */
 
-//#include <unistd.h>
+#include <direct.h>
+#include <io.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -22,7 +23,7 @@
 
 #define LINE_MAX 1024
 char* programname;
-char rosbeappdata[260];
+char rosbeappdata[248];
 char shortcutfile[260];
 
 PSHORTCUT addshortcut(PSHORTCUT ptr, char* name, char* path);
@@ -44,10 +45,18 @@
     int removed = 0;
     programname = argv[0];
 
-    strcpy(rosbeappdata, getenv("APPDATA"));
+#if defined(WIN32)
+    strncpy(rosbeappdata, getenv("APPDATA"), 241);
     strcat(rosbeappdata, "\\RosBE");
     strcpy(shortcutfile, rosbeappdata);
     strcat(shortcutfile, "\\srclist.txt");
+#else
+    strncopy(rosbeappdata, getenv("HOME"), 240);
+    strcat(rosbeappdata, "/.RosBE");
+    strcpy(shortcutfile, rosbeappdata);
+    strcat(shortcutfile, "/srclist.txt");
+#endif
+
     checkfile();
 
     if (argc > 4)
@@ -336,14 +345,14 @@
     fp = fopen(shortcutfile, "r");
     if (!fp)
     {
-/*        if(access(rosbeappdata, F_OK) == -1)
+        if(_access(rosbeappdata, 0) == -1)
         {
             // Directory does not exist, create it
-            if(mkdir(rosbeappdata) == -1)
+            if(_mkdir(rosbeappdata) == -1)
             {
                 fprintf(stderr, "%s: Error creating the directory for the RosBE files.\n", programname);
             }
-        }*/
+        }
 
         fp = fopen(shortcutfile, "w");
         if (!fp)
@@ -387,11 +396,11 @@
 int checkpath(char* path)
 {
     char currentdir[260];
-    getcwd(currentdir, 260);
-    if (!chdir(path))
-    {
-        getcwd(path, 260);
-        chdir(currentdir);
+    _getcwd(currentdir, 260);
+    if (!_chdir(path))
+    {
+        _getcwd(path, 260);
+        _chdir(currentdir);
         return 1;
     }
 

Added: trunk/tools/RosBE/RosBE-Windows/Tools/scut.vcproj
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Tools/scut.vcproj?rev=30654&view=auto
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Tools/scut.vcproj (added)
+++ trunk/tools/RosBE/RosBE-Windows/Tools/scut.vcproj Thu Nov 22 01:22:39 2007
@@ -1,0 +1,185 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8,00"
+	Name="scut"
+	ProjectGUID="{4698046D-30AC-49E1-A767-520A75AA06FE}"
+	RootNamespace="scut"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath="scut.c"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

Propchange: trunk/tools/RosBE/RosBE-Windows/Tools/scut.vcproj
------------------------------------------------------------------------------
    svn:eol-style = native




More information about the Ros-diffs mailing list