Hi,

Hi,


On 19.09.2012 20:00, Oliver-Rainer Wittmann wrote:

On 19.09.2012 08:44, Oliver-Rainer Wittmann wrote:
  Hi,

  On 19.09.2012 04:50, Pedro Giffuni wrote:
  Hi again;

  I tried something in revision 1387438: basically I preserved some
  configuration changes from the previous patchset.


  Thanks
  I will try.


The build with --enable-dbgutil still breaks in setup_native.


I did a small cleanup of the FreeBSD specific patch but sadly,
I am afraid I ran out of my Windows-fu :(.

I found this
http://cubicspot.blogspot.com/2007/06/solving-pesky-lnk2005-errors.html


I think it may be something really simple, but we need a Windows
expert here.

It would be really sad to have to revert the update so I hope someone
steps in!


I do not think that it is needed to revert the boost update.
The problem only occurs when building with --enable-dbgutil and it is quite easy
to get rid of the boost::scoped_array usage in the corresponding small code
snippet.


Does the attached patch make sense in order to get rid of the problem by removing the usage of boost::scoped_array?

Thx in advance for your feedback.

Best regards, Oliver.
diff --git 
a/main/setup_native/source/win32/customactions/shellextensions/copyeditiondata.cxx
 
b/main/setup_native/source/win32/customactions/shellextensions/copyeditiondata.cxx
index a881da3..055cc6d 100644
--- 
a/main/setup_native/source/win32/customactions/shellextensions/copyeditiondata.cxx
+++ 
b/main/setup_native/source/win32/customactions/shellextensions/copyeditiondata.cxx
@@ -38,8 +38,6 @@
 #pragma warning(pop)
 #endif
 
-#include "boost/scoped_array.hpp"
-
 #define LCL_LENGTH0(s) (sizeof (s) / sizeof *(s))
 #define LCL_STRING0(s) (s), LCL_LENGTH0(s)
 
@@ -80,10 +78,36 @@ wchar_t * getProperty(
 
 }
 
+namespace {
+    class scoped_wchar_t_array
+    {
+    private:
+        wchar_t* mpArray;
+
+    public:
+        scoped_wchar_t_array( wchar_t* pArray )
+            : mpArray( pArray )
+        {}
+
+        ~scoped_wchar_t_array()
+        {
+            if ( mpArray != 0 )
+            {
+                delete[] mpArray;
+            }
+        }
+
+        wchar_t* get()
+        {
+            return mpArray;
+        }
+    };
+}
+
 extern "C" UINT __stdcall copyEditionData(MSIHANDLE install) {
-    boost::scoped_array<wchar_t> from(
+    scoped_wchar_t_array from(
         getProperty(install, L"SourceDir", LCL_STRING0(L"edition\0")));
-    if (!from) {
+    if (!from.get()) {
         return ERROR_INSTALL_FAILURE;
     }
     Status stat = fileExists(from.get());
@@ -94,11 +118,11 @@ extern "C" UINT __stdcall copyEditionData(MSIHANDLE 
install) {
         return ERROR_SUCCESS;
     }
     wchar_t * end;
-    boost::scoped_array<wchar_t> to(
+    scoped_wchar_t_array to(
         getProperty(
             install, L"INSTALLLOCATION",
             LCL_STRING0(L"program\\edition\0"), &end));
-    if (!to) {
+    if (!to.get()) {
         return ERROR_INSTALL_FAILURE;
     }
     stat = fileExists(to.get());

Reply via email to