This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Integrating Ralf's rebase into setup.exe


I needed to make the following changes before this would compile. Mostly namespace errors, but also a typo and main() void vs. int.

I figured the library files should explicitly call std::cout & friends, but the executables could go ahead and say 'using namespace std;'.

Oh, a few other niggles: why does Makefile have DOS line-endings, but all the other files have UNIX line-endings? README needs a brief note about this 0.6 version. And shouldn't there be a ChangeLog?

--Chuck
Index: checkimage.cc
===================================================================
RCS file: /cvsroot/kde-cygwin/tools/rebase/checkimage.cc,v
retrieving revision 1.3
diff -u -r1.3 checkimage.cc
--- checkimage.cc	31 Dec 2002 12:56:48 -0000	1.3
+++ checkimage.cc	31 Dec 2002 15:14:42 -0000
@@ -27,12 +27,12 @@
 
 BOOL CheckImage(LPSTR filename)
 {
-  ctFile dll(filename);
+  LinkedObjectFile dll(filename);
 
   if (!dll.isLoaded())
     {
       if (Base::debug)
-        cout << "error: could not open file" << endl;
+        std::cout << "error: could not open file" << std::endl;
       SetLastError(ERROR_FILE_NOT_FOUND);
       return false;
     }
@@ -40,7 +40,7 @@
   if (!dll.checkRelocations())
     {
       if (Base::debug)
-        cout << "dll relocation errors - please fix the errors at first" << endl;
+        std::cout << "dll relocation errors - please fix the errors at first" << std::endl;
       SetLastError(ERROR_INVALID_DATA);
       return false;
     }
Index: fiximage.cc
===================================================================
RCS file: /cvsroot/kde-cygwin/tools/rebase/fiximage.cc,v
retrieving revision 1.3
diff -u -r1.3 fiximage.cc
--- fiximage.cc	31 Dec 2002 12:56:48 -0000	1.3
+++ fiximage.cc	31 Dec 2002 15:14:42 -0000
@@ -29,12 +29,12 @@
   LinkedObjectFile dll(filename,true);
 
   if (Base::debug)
-    cout << filename << ": " << endl;
+    std::cout << filename << ": " << std::endl;
 
   if (!dll.isLoaded())
     {
       if (Base::debug)
-        cout << "error: could not open file" << endl;
+        std::cout << "error: could not open file" << std::endl;
       SetLastError(ERROR_FILE_NOT_FOUND);
       return false;
     }
@@ -42,7 +42,7 @@
   if (!dll.fixRelocations())
     {
       if (Base::debug)
-        cout << "error: could not fix relocation problems" << endl;
+        std::cout << "error: could not fix relocation problems" << std::endl;
       SetLastError(ERROR_INVALID_DATA);
       return false;
     }
Index: getimageinfos.cc
===================================================================
RCS file: /cvsroot/kde-cygwin/tools/rebase/getimageinfos.cc,v
retrieving revision 1.3
diff -u -r1.3 getimageinfos.cc
--- getimageinfos.cc	31 Dec 2002 12:56:48 -0000	1.3
+++ getimageinfos.cc	31 Dec 2002 15:14:42 -0000
@@ -34,7 +34,7 @@
   if (!dll.isLoaded())
     {
       if (Base::debug)
-        cout << "error: could not open file" << endl;
+        std::cout << "error: could not open file" << std::endl;
       SetLastError(ERROR_FILE_NOT_FOUND);
       return false;
     }
@@ -43,7 +43,7 @@
   *ImageSize = dll.getNTHeader()->OptionalHeader.SizeOfImage;
 
   if (Base::debug)
-    cout << "ImageBase: 0x" << hex << *ImageBase << " ImageSize: 0x" << *ImageSize << endl;
+    std::cout << "ImageBase: 0x" << std::hex << *ImageBase << " ImageSize: 0x" << *ImageSize << std::endl;
 
   SetLastError(NO_ERROR);
   return true;
Index: rebase_main.cc
===================================================================
RCS file: /cvsroot/kde-cygwin/tools/rebase/rebase_main.cc,v
retrieving revision 1.1
diff -u -r1.1 rebase_main.cc
--- rebase_main.cc	31 Dec 2002 11:08:08 -0000	1.1
+++ rebase_main.cc	31 Dec 2002 15:14:44 -0000
@@ -48,7 +48,7 @@
 int theListFlag = 0;
 
 
-void
+int
 main(int argc, char* argv[])
 {
   ParseArgs(argc, argv);
Index: rebaseimage.cc
===================================================================
RCS file: /cvsroot/kde-cygwin/tools/rebase/rebaseimage.cc,v
retrieving revision 1.2
diff -u -r1.2 rebaseimage.cc
--- rebaseimage.cc	31 Dec 2002 12:56:48 -0000	1.2
+++ rebaseimage.cc	31 Dec 2002 15:14:44 -0000
@@ -54,7 +54,7 @@
   if (!dll.checkRelocations())
     {
       if (Base::debug)
-        cout << "error: dll relocation errors - please fix the errors at first" << endl;
+        std::cout << "error: dll relocation errors - please fix the errors at first" << std::endl;
       SetLastError(ERROR_INVALID_DATA);
       return false;
     }
@@ -84,7 +84,7 @@
   if (ntheader->OptionalHeader.ImageBase == *NewImageBase)
     {
       if (Base::debug)
-        cout << "dll is already rebased" << endl;
+        std::cout << "dll is already rebased" << std::endl;
       SetLastError(NO_ERROR);
       return true;
     }
@@ -97,7 +97,7 @@
   if (!dll.performRelocation(difference))
     {
       if (Base::debug)
-        cout << "error: could not rebase image" << endl;
+        std::cout << "error: could not rebase image" << std::endl;
       SetLastError(ERROR_BAD_FORMAT);
       return false;
     }
Index: unbind_main.cc
===================================================================
RCS file: /cvsroot/kde-cygwin/tools/rebase/unbind_main.cc,v
retrieving revision 1.3
diff -u -r1.3 unbind_main.cc
--- unbind_main.cc	31 Dec 2002 12:56:48 -0000	1.3
+++ unbind_main.cc	31 Dec 2002 15:14:44 -0000
@@ -30,6 +30,8 @@
 
 #include "objectfile.h"
 
+using namespace std;
+
 char *Win32Path(char *s);
 void Usage();
 int fVerbose = 1;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]