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

List:       helix-video-dev
Subject:    RE: [Video-dev] InterlockedIncrement and MS platform sdk (was
From:       Liam Murray <liamm () real ! com>
Date:       2004-04-01 18:55:12
Message-ID: 6.0.1.1.0.20040401103600.039507b0 () mailone ! real ! com
[Download RAW message or body]

This is a MIME-formatted message.  If you see this text it means that your
E-mail software does not support MIME-formatted messages.


Yeah, I agree... I wasn't comfortable with the NOWINBASEINTERLOCK define to 
begin with. I really meant to suggest it only to get building so you (and 
I) could continue work until a better solution could be found.  One problem 
is that you pick up the declaration in _threads.h but  the msvc linker and 
compiler assume the declarations in winbase.h. (I'm not sure how pragma 
intrinsic actually inlines code, i.e., where does it get the body from.)

I wonder if the best solution is to modify  _threads.h so that its 
declarations match those in whatever version of winbase.h is being used.

For example, the following works for me. This is just the idea, not a 
proposed solution. It has a good potential to break with older (or later) 
versions of the platfrom sdk, I'm not sure how to identify the version 
installed. But it does work for me so that I can build and run fine.


somewhere in the .cf file:

try:
         if(GetSDKPath("ms_psdk")):
                 # so stlport/stl/_threads.h conforms with winbase.h
                 project.AddDefines("STLPORT_INTERLOCKED_VOLATILE_ARG")
except:
         pass

in stlport/stl/_threads.h (around line 93)

//XXXLCM
#if defined STLPORT_INTERLOCKED_VOLATILE_ARG
#define INTERLOCKED_VOLITILE volatile
#else
#define INTERLOCKED_VOLITILE
#endif

__STL_IMPORT_DECLSPEC long __STL_STDCALL InterlockedIncrement(long 
INTERLOCKED_VOLITILE *);
__STL_IMPORT_DECLSPEC long __STL_STDCALL InterlockedDecrement(long 
INTERLOCKED_VOLITILE *);
__STL_IMPORT_DECLSPEC long __STL_STDCALL InterlockedExchange(long 
INTERLOCKED_VOLITILE *, long);


At 11:39 PM 3/31/2004, Josh Taylor wrote:
>I'm having similar STLport/PSDK issues when I try to build the release 
>version of Helix with win32-i386-vc7.cf for windows. I am able to build 
>fine with vc6, however, I'm trying to integrate Panda3D and Helix 
>together. As of now, Panda is built with vc7 so it would be best for me to 
>build both platforms with the same compiler. I downloaded the latest 
>STLport (4.6.1), compiled it under vc7, installed the libraries and DLLs, 
>and updated the headers in the "common\import\stlport" directory.
>
>I saw Liam's reply to my question in the STLport.org forums, and I added 
>the project.addDefines("NOWINBASEINTERLOCK") however that alone did not 
>solve my problem. In _threads.h from STLport, I was receiving
>errors on these lines of code:
>
>Errors:
>..\..\common\import\stlport\stl\_windows.h(49) : error C2059: syntax error 
>: ')'
>..\..\common\import\stlport\stl\_windows.h(50) : error C2059: syntax error 
>: ')'
>
>Code:
>_STLP_IMPORT_DECLSPEC long _STLP_STDCALL InterlockedIncrement(long 
>volatile *);
>_STLP_IMPORT_DECLSPEC long _STLP_STDCALL InterlockedDecrement(long 
>volatile *);
>
>For some reason, InterlockedIncrement is not being defined properly, ie. 
>#define InterlockedIncrement _Interlocked Increment. I then added those defines
>Before the code above and that resolved the issue and I was able to 
>successfully build. However, I'm not overly comfortable with this solution 
>(it is a hack). If anyone knows why InterlockedIncrement and 
>InterlockedDecrement are not being defined properly, I could use the help.
>
>Josh
>
>-----Original Message-----
>From: video-dev-bounces@lists.helixcommunity.org 
>[mailto:video-dev-bounces@lists.helixcommunity.org] On Behalf Of Liam Murray
>Sent: Wednesday, March 31, 2004 6:17 PM
>To: Greg Wright; video-dev@lists.helixcommunity.org; Rishi Mathew
>Cc: helix-client-dev@lists.helixcommunity.org
>Subject: [Video-dev] InterlockedIncrement and MS platform sdk (was CR:New 
>Platform WinCE 4.20 on x86)
>
>I'm getting the same errors after installing the latest MS Platform SDK.
>
>The error occurs when winbase.h is included from the platform SDK include 
>directory.
>
>winbase.h(1298): error C2733: second C linkage of overloaded
>function 'InterlockedIncrement' not allowed
>  This arises from a conflict with function declarations in 
> common\import\stlport\stl\_threads.h, which is picked up via 
> stlport\memory, which is included in hxtypes.h.
>
>The win32-i386-vc6.cf file adds stlport to the include line for every 
>module everywhere for win32-i386-vc6 builds.
>
>## additional includes
>project.AddModuleIncludes("stlport")
>project.AddModuleIncludes("common/import/stlport")
>
>If I comment these out I can build. I can also add 
>platform.AddDefines("NOWINBASEINTERLOCK") or something like that to 
>prevent the declarations in winbase.h. Neither of these seem like 
>good  solutions. Perhaps a better solution might be to modify _threads.h 
>so it's declarations conform with those in winbase.h  when the platform 
>sdk is installed.
>
>Actually, I'm surprised that this is failing because it looks like someone 
>has already successfully built with the platform sdk for purposes of 
>including some of the advanced networking stuff. (I just installed the 
>platform sdk a couple of days ago.)
>
>
>Liam
>
>
>At 02:39 PM 3/31/2004, Greg Wright wrote:
>
> > Greg,
> >
> > The print.h is located in the common\print directory. I believe he has
> > created this sub-dir
> > In the BIF file, a seperate common_print module is also specified..
> > Attaching the print.h and print.cpp file in the zip.
> >
> > I have tested these changes and there are no build errors in the video
> > module...
>
>I am not so worried about building but more concerned about functional
>testing. Like with some SMIL that does alphablending; given the changes.
>
>Henry might be able to help with that MS SDK thing.
>
>--greg.
>
>
> >
> > However I am not getting a clean build because of one error in the
> > client\common\netio module. Probably because of the Microsoft Platform 
> SDK.
> > Any opinions on this one...
> >
> >
> > D:\feb0204\client\common\netio>nmake
> >
> > Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
> > Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
> >
> >          cl /nologo /Zp1 /Zm200 /W3 /GX- /Od  /I. /I.\win /I.\pub
> > /I.\pub\win /I.
> > .\..\..\common\runtime\pub /I..\..\..\stlport
> > /I..\..\..\common\import\stlport "
> > /ID:\Microsoft SDK\include" /I..\..\..\common\include
> > /I..\..\..\common\netio\pu
> > b /I..\..\..\common\container\pub /I..\..\..\common\util\pub
> > /I..\..\..\common\f
> > ileio\pub /I..\..\..\common\dbgtool\pub /I..\..\..\common\system\pub /I.
> > /FIdbg3
> > 2\client_common_netio_ribodefs.h  /MDd /Z7
> > /Fodbg32\obj\platform\win\hxnetif.obj
> >   /c  platform\win\hxnetif.cpp
> > hxnetif.cpp
> > D:\Microsoft SDK\include\winbase.h(1392) : error C2733: second C 
> linkage of
> > over
> > loaded function 'InterlockedIncrement' not allowed
> >          D:\Microsoft SDK\include\winbase.h(1390) : see declaration of
> > 'Interlock
> > edIncrement'
> > D:\Microsoft SDK\include\winbase.h(1399) : error C2733: second C 
> linkage of
> > over
> > loaded function 'InterlockedDecrement' not allowed
> >          D:\Microsoft SDK\include\winbase.h(1397) : see declaration of
> > 'Interlock
> > edDecrement'
> > D:\Microsoft SDK\include\winbase.h(1407) : error C2733: second C 
> linkage of
> > over
> > loaded function 'InterlockedExchange' not allowed
> >          D:\Microsoft SDK\include\winbase.h(1404) : see declaration of
> > 'Interlock
> > edExchange'
> > NMAKE : fatal error U1077: 'cl' : return code '0x2'
> > Stop.
> >
> > D:\feb0204\client\common\netio>
> >
> >
> > -Rishi.
>
>
>_______________________________________________
>Video-dev mailing list
>Video-dev@lists.helixcommunity.org
>http://lists.helixcommunity.org/mailman/listinfo/video-dev
>_______________________________________________
>Video-dev mailing list
>Video-dev@lists.helixcommunity.org
>http://lists.helixcommunity.org/mailman/listinfo/video-dev

[Attachment #3 (text/html)]

<html>
<body>
Yeah, I agree... I wasn't comfortable with the NOWINBASEINTERLOCK define
to begin with. I really meant to suggest it only to get building so you
(and I) could continue work until a better solution could be found.&nbsp;
One problem is that you pick up the declaration in _threads.h but&nbsp;
the msvc linker and compiler assume the declarations in winbase.h. (I'm
not sure how pragma intrinsic actually inlines code, i.e., where does it
get the body from.)<br><br>
I wonder if the best solution is to modify&nbsp; _threads.h so that its
declarations match those in whatever version of winbase.h is being
used.<br><br>
For example, the following works for me. This is just the idea, not a
proposed solution. It has a good potential to break with older (or later)
versions of the platfrom sdk, I'm not sure how to identify the version
installed. But it does work for me so that I can build and run
fine.<br><br>
<br>
somewhere in the .cf file:<br><br>
try:<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>if(GetSDKPath(&quot;ms_psdk&quot;)):<br>
 <x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>#
 so stlport/stl/_threads.h conforms with winbase.h<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>project.AddDefines(&quot;STLPORT_INTERLOCKED_VOLATILE_ARG&quot;)<br>
 except:<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>pass<br><br>
in stlport/stl/_threads.h (around line 93)<br><br>
//XXXLCM<br>
#if defined STLPORT_INTERLOCKED_VOLATILE_ARG<br>
#define INTERLOCKED_VOLITILE volatile<br>
#else<br>
#define INTERLOCKED_VOLITILE<br>
#endif<br><br>
__STL_IMPORT_DECLSPEC long __STL_STDCALL InterlockedIncrement(long
INTERLOCKED_VOLITILE *);<br>
__STL_IMPORT_DECLSPEC long __STL_STDCALL InterlockedDecrement(long
INTERLOCKED_VOLITILE *);<br>
__STL_IMPORT_DECLSPEC long __STL_STDCALL InterlockedExchange(long
INTERLOCKED_VOLITILE *, long);<br><br>
<br>
At 11:39 PM 3/31/2004, Josh Taylor wrote:<br>
<blockquote type=cite class=cite cite><font face="arial" size=2 color="#000080">I’m
having similar STLport/PSDK issues when I try to build the release
version of Helix with win32-i386-vc7.cf for windows. I am able to build
fine with vc6, however, I’m trying to integrate Panda3D and Helix
together. As of now, Panda is built with vc7 so it would be best for me
to build both platforms with the same compiler. I downloaded the latest
STLport (4.6.1), compiled it under vc7, installed the libraries and DLLs,
and updated the headers in the “common\import\stlport” directory.<br>
&nbsp;<br>
I saw Liam’s reply to my question in the STLport.org forums, and I added
the project.addDefines(“NOWINBASEINTERLOCK”) however that alone did not
solve my problem. In _threads.h from STLport, I was receiving<br>
errors on these lines of code:<br>
&nbsp;<br>
Errors:<br>
</font><font face="tahoma" size=2 \
color="#325A30">..\..\common\import\stlport\stl\_windows.h(49) : error C2059: syntax \
                error : ')'<br>
..\..\common\import\stlport\stl\_windows.h(50) : error C2059: syntax
error : ')'<br>
</font><font face="arial" size=2 color="#000080">&nbsp;<br>
Code:<br>
</font><font face="Courier New, Courier" size=2>_STLP_IMPORT_DECLSPEC
</font><font face="Courier New, Courier" size=2 color="#0000FF">long</font><font \
face="Courier New, Courier" size=2> _STLP_STDCALL
InterlockedIncrement(</font><font face="Courier New, Courier" size=2 \
color="#0000FF">long</font><font face="Courier New, Courier" size=2> </font><font \
face="Courier New, Courier" size=2 color="#0000FF">volatile</font><font face="Courier \
                New, Courier" size=2>
*);<br>
_STLP_IMPORT_DECLSPEC
</font><font face="Courier New, Courier" size=2 color="#0000FF">long</font><font \
face="Courier New, Courier" size=2> _STLP_STDCALL
InterlockedDecrement(</font><font face="Courier New, Courier" size=2 \
color="#0000FF">long</font><font face="Courier New, Courier" size=2> </font><font \
face="Courier New, Courier" size=2 color="#0000FF">volatile</font><font face="Courier \
                New, Courier" size=2>
*);<br>
&nbsp;<br>
For some reason, InterlockedIncrement is not being defined properly, ie.
#define InterlockedIncrement _Interlocked Increment. I then added those
defines<br>
Before the code above and that resolved the issue and I was able to
successfully build. However, I’m not overly comfortable with this
solution (it is a hack). If anyone knows why InterlockedIncrement and
InterlockedDecrement are not being defined properly, I could use the
help.<br>
&nbsp;<br>
Josh<br>
</font><font face="arial" size=2 color="#000080">&nbsp;<br>
</font><font face="tahoma" size=2>-----Original Message-----<br>
<b>From:</b> video-dev-bounces@lists.helixcommunity.org
[<a href="mailto:video-dev-bounces@lists.helixcommunity.org" \
eudora="autourl">mailto:video-dev-bounces@lists.helixcommunity.org</a>] <b>On Behalf \
Of </b>Liam Murray<br> <b>Sent:</b> Wednesday, March 31, 2004 6:17 PM<br>
<b>To:</b> Greg Wright; video-dev@lists.helixcommunity.org; Rishi
Mathew<br>
<b>Cc:</b> helix-client-dev@lists.helixcommunity.org<br>
<b>Subject:</b> [Video-dev] InterlockedIncrement and MS platform sdk (was
CR:New Platform WinCE 4.20 on x86)<br>
</font><font face="Times New Roman, Times">&nbsp;<br>
I'm getting the same errors after installing the latest MS Platform
SDK.<br><br>
The error occurs when winbase.h is included from the platform SDK include
directory.<br>
</font><br>
<pre><font face="Courier New, Courier" size=2>winbase.h(1298): error
C2733: second C linkage of
overloaded</font></pre><font face="Courier New, Courier"></font><br>
<pre><font face="Courier New, Courier" size=2>function
'InterlockedIncrement' not
allowed</font></pre><font face="Courier New, Courier"></font><br>
<pre><font face="Courier New, Courier" size=2>&nbsp;</font></pre><font face="Courier \
New, Courier"></font><font face="Times New Roman, Times">This arises from a conflict \
with function declarations in common\import\stlport\stl\_threads.h, which is picked \
up via stlport\memory, which is included in hxtypes.h.<br><br>
The win32-i386-vc6.cf file adds stlport to the include line for every
module everywhere for win32-i386-vc6 builds.<br><br>
## additional includes<br>
project.AddModuleIncludes(&quot;stlport&quot;)<br>
project.AddModuleIncludes(&quot;common/import/stlport&quot;)<br><br>
If I comment these out I can build. I can also add
platform.AddDefines(&quot;NOWINBASEINTERLOCK&quot;) or something like
that to prevent the declarations in winbase.h. Neither of these seem like
good&nbsp; solutions. Perhaps a better solution might be to modify
_threads.h so it's declarations conform with those in winbase.h&nbsp;
when the platform sdk is installed.<br><br>
Actually, I'm surprised that this is failing because it looks like
someone has already successfully built with the platform sdk for purposes
of including some of the advanced networking stuff. (I just installed the
platform sdk a couple of days ago.)<br><br>
<br>
Liam<br><br>
<br>
At 02:39 PM 3/31/2004, Greg Wright wrote:<br><br>
&gt; Greg,<br>
&gt; <br>
&gt; The print.h is located in the common\print directory. I believe he
has <br>
&gt; created this sub-dir<br>
&gt; In the BIF file, a seperate common_print module is also
specified..<br>
&gt; Attaching the print.h and print.cpp file in the zip.<br>
&gt; <br>
&gt; I have tested these changes and there are no build errors in the
video <br>
&gt; module...<br><br>
I am not so worried about building but more concerned about
functional<br>
testing. Like with some SMIL that does alphablending; given the
changes.<br><br>
Henry might be able to help with that MS SDK thing.<br><br>
--greg.<br><br>
<br>
&gt; <br>
&gt; However I am not getting a clean build because of one error in the
<br>
&gt; client\common\netio module. Probably because of the Microsoft
Platform SDK. <br>
&gt; Any opinions on this one...<br>
&gt; <br>
&gt; <br>
&gt; D:\feb0204\client\common\netio&gt;nmake<br>
&gt; <br>
&gt; Microsoft (R) Program Maintenance Utility&nbsp;&nbsp; Version
6.00.8168.0<br>
&gt; Copyright (C) Microsoft Corp 1988-1998. All rights reserved.<br>
&gt; <br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cl /nologo
/Zp1 /Zm200 /W3 /GX- /Od&nbsp; /I. /I.\win /I.\pub <br>
&gt; /I.\pub\win /I.<br>
&gt; .\..\..\common\runtime\pub /I..\..\..\stlport <br>
&gt; /I..\..\..\common\import\stlport &quot;<br>
&gt; /ID:\Microsoft SDK\include&quot; /I..\..\..\common\include <br>
&gt; /I..\..\..\common\netio\pu<br>
&gt; b /I..\..\..\common\container\pub /I..\..\..\common\util\pub <br>
&gt; /I..\..\..\common\f<br>
&gt; ileio\pub /I..\..\..\common\dbgtool\pub /I..\..\..\common\system\pub
/I. <br>
&gt; /FIdbg3<br>
&gt; 2\client_common_netio_ribodefs.h&nbsp; /MDd /Z7 <br>
&gt; /Fodbg32\obj\platform\win\hxnetif.obj<br>
&gt;&nbsp;&nbsp; /c&nbsp; platform\win\hxnetif.cpp<br>
&gt; hxnetif.cpp<br>
&gt; D:\Microsoft SDK\include\winbase.h(1392) : error C2733: second C
linkage of <br>
&gt; over<br>
&gt; loaded function 'InterlockedIncrement' not allowed<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; D:\Microsoft
SDK\include\winbase.h(1390) : see declaration of <br>
&gt; 'Interlock<br>
&gt; edIncrement'<br>
&gt; D:\Microsoft SDK\include\winbase.h(1399) : error C2733: second C
linkage of <br>
&gt; over<br>
&gt; loaded function 'InterlockedDecrement' not allowed<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; D:\Microsoft
SDK\include\winbase.h(1397) : see declaration of <br>
&gt; 'Interlock<br>
&gt; edDecrement'<br>
&gt; D:\Microsoft SDK\include\winbase.h(1407) : error C2733: second C
linkage of <br>
&gt; over<br>
&gt; loaded function 'InterlockedExchange' not allowed<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; D:\Microsoft
SDK\include\winbase.h(1404) : see declaration of <br>
&gt; 'Interlock<br>
&gt; edExchange'<br>
&gt; NMAKE : fatal error U1077: 'cl' : return code '0x2'<br>
&gt; Stop.<br>
&gt; <br>
&gt; D:\feb0204\client\common\netio&gt;<br>
&gt; <br>
&gt; <br>
&gt; -Rishi.<br><br>
<br>
_______________________________________________<br>
Video-dev mailing list<br>
Video-dev@lists.helixcommunity.org<br>
<a href="http://lists.helixcommunity.org/mailman/listinfo/video-dev" \
eudora="autourl">http://lists.helixcommunity.org/mailman/listinfo/video-dev</a><br> \
</font>_______________________________________________<br> Video-dev mailing list<br>
Video-dev@lists.helixcommunity.org<br>
<a href="http://lists.helixcommunity.org/mailman/listinfo/video-dev" \
eudora="autourl">http://lists.helixcommunity.org/mailman/listinfo/video-dev</a></blockquote></body>
 </html>



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

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