[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nsis-bugs
Subject:    [NSIS-Bugs] [ nsis-Patches-2497172 ] [PATCH] Fixes for POSIX build
From:       "SourceForge.net" <noreply () sourceforge ! net>
Date:       2009-01-17 22:35:14
Message-ID: E1LOJl4-0004iK-PW () 155xhf1 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Patches item #2497172, was opened at 2009-01-10 07:13
Message generated for change (Settings changed) made by kichik
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=373087&aid=2497172&group_id=22049

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
> Status: Closed
> Resolution: Accepted
Priority: 5
Private: No
Submitted By: Daniel Richard G. (skunk)
> Assigned to: Amir Szekely (kichik)
Summary: [PATCH] Fixes for POSIX build on Solaris, plus a regression

Initial Comment:
Ran into a few minor issues building makensis on Solaris. The attached patch fixes \
these:

1. <cstdio> doesn't define FILE*; this may be found in <fstream>.

2. munmap() and msync() must take a char* as their first argument, not a void*.

3. Without <locale.h>, LC_CTYPE is undefined.

4. The last item in an enum list must not be followed by a comma.


There is one complication, however, that must be addressed before the patch can be \
applied. As soon as you add <fstream> to Source/strlist.h, you get the following \
error when building back on Linux:

----BEGIN CRAZY COMPLICATED C++ ERROR----
g++ -o build/release/makensis/util.o -c -Wno-non-virtual-dtor -O2 -Wall -m32 -I. \
-Iexehead "-DNSISCALL= __attribute__((__stdcall__))" -D_WIN32_IE=0x0500 \
                /tmp/nsis-2.42-src/Source/util.cpp
/tmp/nsis-2.42-src/Source/util.cpp: In function `int
   WideCharToMultiByte(unsigned int, unsigned int, const short unsigned int*,
   int, char*, int, const char*, int*)':
/tmp/nsis-2.42-src/Source/util.cpp:224: error: call of overloaded
   `__iconv_adaptor(size_t (&)(void*, char**, size_t*, char**, size_t*),
   void*&, char**, size_t*, char**, size_t*)' is ambiguous
/tmp/nsis-2.42-src/Source/util.cpp:186: error: candidates are:
   size_t __iconv_adaptor(size_t (*)(void*, T, size_t*, char**, size_t*),
   void*, char**, size_t*, char**, size_t*) [with T = char**]
/usr/include/c++/3.3/i486-linux/bits/codecvt_specializations.h:253: error:
              size_t std::__iconv_adaptor(size_t (*)(void*, _T, size_t*,
   char**, size_t*), void*, char**, size_t*, char**, size_t*) [with _T =
   char**]
/tmp/nsis-2.42-src/Source/util.cpp: In function `int
   MultiByteToWideChar(unsigned int, unsigned int, const char*, int, short
   unsigned int*, int)':
/tmp/nsis-2.42-src/Source/util.cpp:260: error: call of overloaded
   `__iconv_adaptor(size_t (&)(void*, char**, size_t*, char**, size_t*),
   void*&, char**, size_t*, char**, size_t*)' is ambiguous
/tmp/nsis-2.42-src/Source/util.cpp:186: error: candidates are:
   size_t __iconv_adaptor(size_t (*)(void*, T, size_t*, char**, size_t*),
   void*, char**, size_t*, char**, size_t*) [with T = char**]
/usr/include/c++/3.3/i486-linux/bits/codecvt_specializations.h:253: error:
              size_t std::__iconv_adaptor(size_t (*)(void*, _T, size_t*,
   char**, size_t*), void*, char**, size_t*, char**, size_t*) [with _T =
   char**]
scons: *** [build/release/makensis/util.o] Error 1
scons: building terminated because of errors.
----END CRAZY COMPLICATED C++ ERROR----

I've got nothing on that :-(

----------------------------------------------------------------------

Comment By: Daniel Richard G. (skunk)
Date: 2009-01-17 05:23

Message:
I don't see a way to quiet that warning (adding 'extern "C"' to the
function-pointer-argument definition doesn't work), so I can't argue with
punting it.

New patch is attached.

----------------------------------------------------------------------

Comment By: Amir Szekely (kichik)
Date: 2009-01-16 13:34

Message:
Well, not exactly. It's not a copy of GCC-land function but it is a copy of
something. I guess GCC just copied it from the same place and changed
something in the signature.

As for the Solaris error, it seems to be complaining about the function
being passed as extern "C". I don't see why it should care, so I say we
ignore this warning.

Can you submit an updated patch so I can apply it?

----------------------------------------------------------------------

Comment By: Daniel Richard G. (skunk)
Date: 2009-01-16 09:31

Message:
Ohh, I get what you're saying---the function is defined by NSIS, but it's
basically a copy of an internal function from GCC-land. The name stayed the
same, but for some reason the signatures are slightly different, thus the
conflict.

After replacing all three instances of "__iconv_adaptor" with e.g.
"nsis_iconv_adaptor" in Source/util.cpp, everything builds on both Linux
and Solaris.

Though the Solaris compiler does give these warnings:

/opt/SUNWspro/bin/CC -o build/release/makensis/util.o -c -I. -Iexehead
-DNSISCALL= -D_WIN32_IE=0x0500 /tmp/nsis-2.42-src/Source/util.cpp
"/tmp/nsis-2.42-src/Source/util.cpp", line 225: Warning (Anachronism):
Formal argument iconv_func of type unsigned(*)(_iconv_info*,const
char**,unsigned*,char**,unsigned*) in call to nsis_iconv_adaptor<const
char**>(unsigned(*)(_iconv_info*,const char**,unsigned*,char**,unsigned*),
_iconv_info*, char**, unsigned*, char**, unsigned*) is being passed extern
"C" unsigned(*)(_iconv_info*,const char**,unsigned*,char**,unsigned*).
"/tmp/nsis-2.42-src/Source/util.cpp", line 225: Warning (Anachronism):
Using extern "C" unsigned(*)(_iconv_info*,const
char**,unsigned*,char**,unsigned*) to initialize
unsigned(*)(_iconv_info*,const char**,unsigned*,char**,unsigned*).
"/tmp/nsis-2.42-src/Source/util.cpp", line 261: Warning (Anachronism):
Formal argument iconv_func of type unsigned(*)(_iconv_info*,const
char**,unsigned*,char**,unsigned*) in call to nsis_iconv_adaptor<const
char**>(unsigned(*)(_iconv_info*,const char**,unsigned*,char**,unsigned*),
_iconv_info*, char**, unsigned*, char**, unsigned*) is being passed extern
"C" unsigned(*)(_iconv_info*,const char**,unsigned*,char**,unsigned*).
"/tmp/nsis-2.42-src/Source/util.cpp", line 261: Warning (Anachronism):
Using extern "C" unsigned(*)(_iconv_info*,const
char**,unsigned*,char**,unsigned*) to initialize
unsigned(*)(_iconv_info*,const char**,unsigned*,char**,unsigned*).
4 Warning(s) detected.

----------------------------------------------------------------------

Comment By: Amir Szekely (kichik)
Date: 2009-01-15 16:20

Message:
Did you modify its definition as well?

I don't know anything about the one in the GCC headers as it doesn't exist
in my version. I'd rather have our function another name anyway to prevent
clashes. It's not a documented function, so I don't think it'd be smart to
rely on it.

----------------------------------------------------------------------

Comment By: Daniel Richard G. (skunk)
Date: 2009-01-11 03:21

Message:
If I rename (i.e. delete) the __iconv_adaptor definition in
Source/util.cpp, the Linux build succeeds, but then the Solaris build borks
out with

/opt/SUNWspro/bin/CC -o build/release/makensis/util.o -c -I. -Iexehead
-DNSISCALL= -D_WIN32_IE=0x0500 /tmp/nsis-2.42-src/Source/util.cpp
"/tmp/nsis-2.42-src/Source/util.cpp", line 225: Error: The function
"__iconv_adaptor" must have a prototype.
"/tmp/nsis-2.42-src/Source/util.cpp", line 261: Error: The function
"__iconv_adaptor" must have a prototype.
2 Error(s) detected.
scons: *** [build/release/makensis/util.o] Error 2
scons: building terminated because of errors.

Isn't it possible to make the signature match the one in the GCC headers?
(Or is this a case where there are multiple contradictory definitions of
this function?)

----------------------------------------------------------------------

Comment By: Amir Szekely (kichik)
Date: 2009-01-11 01:12

Message:
It looks like your version of headers already has a definition of
__iconv_adaptor in codecvt_specializations.h. Try renaming it and see if it
works.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=373087&aid=2497172&group_id=22049

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
NSIS-Bugs mailing list
NSIS-Bugs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nsis-bugs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic