🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.upgrade
21 messages
21 total messages Started by Tom Byars Thu, 27 Dec 2007 15:30
mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#11
Author: Tom Byars
Date: Thu, 27 Dec 2007 15:30
16 lines
1780 bytes
I've just installed BCB 2007 and tried to compile a package written and 
working under BCB 6. All units compile OK apart from one which leads to 
meaningless errors consisting of

mswsock.h(401): E2293 ) expected

there's 3 such messages regarding the mswsock.h file although nowhere does 
there appear to be a missing closing bracket. Those 3 errors are then 
followed by 48 errors in the ioswwd file made up of 24 groupings of
Multiple declaration for .........................
followed by
Earlier declaration of ......................

I realise this is all a bit cryptic but the two files containing the errors 
are borland files and I'm wondering if anyone has experienced anything 
similar. 
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#12
Author: Remy Lebeau (TeamB)
Date: Thu, 27 Dec 2007 18:12
19 lines
1905 bytes
"Tom Byars" <tam118118@hotmail.com> wrote in message 
news:4773c52b@newsgroups.borland.com...

> I've just installed BCB 2007 and tried to compile a package written
> and working under BCB 6. All units compile OK apart from one
> which leads to meaningless errors consisting of
>
> mswsock.h(401): E2293 ) expected
>
> there's 3 such messages regarding the mswsock.h file although
> nowhere does there appear to be a missing closing bracket.

What do the lines actually look like?  On my copy of mswsock.h in BCB 6, 
line 401 is inside a comment.  I don't have 2007 on-hand at the moment to 
look at.


Gambit 
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#13
Author: Tom Byars
Date: Fri, 28 Dec 2007 10:53
30 lines
1719 bytes
Remy the offending line is
(PASCAL FAR * LPFN_WSARECVMSG) (

Here's a small portion of the file including the above 'error'.

/*
 * WSARecvMsg -- support for receiving ancilliary
 * data/control information with a message.
 */
typedef
INT
(PASCAL FAR * LPFN_WSARECVMSG) (
    IN SOCKET s,
    IN OUT LPWSAMSG lpMsg,
    __out_opt LPDWORD lpdwNumberOfBytesRecvd,
    IN LPWSAOVERLAPPED lpOverlapped,
    IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
    );




> What do the lines actually look like?  On my copy of mswsock.h in BCB 6, 
> line 401 is inside a comment.  I don't have 2007 on-hand at the moment to 
> look at.
>
>
> Gambit
>
> 
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#14
Author: dhoke
Date: Fri, 28 Dec 2007 13:59
25 lines
2408 bytes
Did you try preprocessing the source file (in bds2006, right click menu in 
project pane on subject source file, select preprocess), and examining the 
preprocessed output, looking at the preprocessed version of the item causing 
the errror?

Your problem seems similar to some I encountered looking at one of the 2007 
trial versions (for bds2006 projects), but I have forgotten specifics - in 
some similar cases I recall finding some local #define's messing with 
parameters or types in the prototype.  (I'm vaguely thinking there was some 
change to B/CG filtered, ms-originating SDK-based winsock headers included 
with 2007, but right now don't recall what, that required some change to 
includes - maybe an add'l include, or something like...)

Be sure you look at the _entire_ prototype - I wasted much time in one case 
because I didn't think the actual problem could be _beyond_ where the 
IDE/compiler was reporting the error, but it was eventually found to be so.

"Tom Byars" <tam118118@hotmail.com> wrote in message 
news:4773c52b@newsgroups.borland.com...
> I've just installed BCB 2007 and tried to compile a package written and 
> working under BCB 6. All units compile OK apart from one which leads to 
> meaningless errors consisting of
>
> mswsock.h(401): E2293 ) expected
>
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#15
Author: Tom Byars
Date: Fri, 28 Dec 2007 17:25
28 lines
2720 bytes
dhoke, thanks for the reply. I tried this but when I do it this way it only 
comes up with a single warning (c:\program files\codegear\rad 
studio\5.0\include\Indy10\Idiohandler.hpp 208: Integer arithmetic overflow) 
and no errors. In the preprocessed file the offending line is listed but 
with no problem reported. Any ideas what's happening. I can't claim to know 
what this 'preprocessing' is about.

"dhoke" <dhoke.nojunk@east-shore.com> wrote in message 
news:477501a1$1@newsgroups.borland.com...
> Did you try preprocessing the source file (in bds2006, right click menu in 
> project pane on subject source file, select preprocess), and examining the 
> preprocessed output, looking at the preprocessed version of the item 
> causing the errror?
>
> Your problem seems similar to some I encountered looking at one of the 
> 2007 trial versions (for bds2006 projects), but I have forgotten 
> specifics - in some similar cases I recall finding some local #define's 
> messing with parameters or types in the prototype.  (I'm vaguely thinking 
> there was some change to B/CG filtered, ms-originating SDK-based winsock 
> headers included with 2007, but right now don't recall what, that required 
> some change to includes - maybe an add'l include, or something like...)
>
> Be sure you look at the _entire_ prototype - I wasted much time in one 
> case because I didn't think the actual problem could be _beyond_ where the 
> IDE/compiler was reporting the error, but it was eventually found to be 
> so.
>
 
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#16
Author: Remy Lebeau (TeamB)
Date: Fri, 28 Dec 2007 17:57
13 lines
1502 bytes
"Tom Byars" <tam118118@hotmail.com> wrote in message 
news:4774d59f$1@newsgroups.borland.com...

> Remy the offending line is
> (PASCAL FAR * LPFN_WSARECVMSG) (

For that line to error, either PASCAL or FAR had to have been redefined 
elsewhere to something it shouldn't be, breaking the declaration for 
LPFN_WSARECVMSG.  Can you output what they are actually set to?


Gambit 
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#17
Author: Remy Lebeau (TeamB)
Date: Fri, 28 Dec 2007 17:58
13 lines
1519 bytes
"Tom Byars" <tam118118@hotmail.com> wrote in message 
news:4775318e$1@newsgroups.borland.com...

> I tried this but when I do it this way it only comes up with a single
> warning (c:\program files\codegear\rad 
> studio\5.0\include\Indy10\Idiohandler.hpp
> 208: Integer arithmetic overflow)

Again, please show the actual code that is reporting the error.


Gambit 
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#18
Author: Tom Byars
Date: Fri, 28 Dec 2007 18:57
20 lines
1806 bytes
Where would I find these redefinitions Remy? I certainly haven't redefined 
them and they're not redefined in mswsock.h.

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:47753961@newsgroups.borland.com...
>
> "Tom Byars" <tam118118@hotmail.com> wrote in message 
> news:4774d59f$1@newsgroups.borland.com...
>
>> Remy the offending line is
>> (PASCAL FAR * LPFN_WSARECVMSG) (
>
> For that line to error, either PASCAL or FAR had to have been redefined 
> elsewhere to something it shouldn't be, breaking the declaration for 
> LPFN_WSARECVMSG.  Can you output what they are actually set to?
>
>
> Gambit
>
> 
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#19
Author: Tom Byars
Date: Fri, 28 Dec 2007 19:02
22 lines
1928 bytes
This is line 208 in Idiohandler.hpp Remy.

	virtual void __fastcall ReadStream(Classes::TStream* AStream, __int64 
AByteCount = 0xffffffffffffffff, bool AReadUntilDisconnect = false);


"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:477539a5$1@newsgroups.borland.com...
>
> "Tom Byars" <tam118118@hotmail.com> wrote in message 
> news:4775318e$1@newsgroups.borland.com...
>
>> I tried this but when I do it this way it only comes up with a single
>> warning (c:\program files\codegear\rad 
>> studio\5.0\include\Indy10\Idiohandler.hpp
>> 208: Integer arithmetic overflow)
>
> Again, please show the actual code that is reporting the error.
>
>
> Gambit
> 
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#20
Author: Remy Lebeau (TeamB)
Date: Fri, 28 Dec 2007 19:41
12 lines
1456 bytes
"Tom Byars" <tam118118@hotmail.com> wrote in message 
news:477546fd@newsgroups.borland.com...

> Where would I find these redefinitions Remy?

You will just have to search all of the header files that your project uses. 
That is why I suggest you output their actual values first to see if they 
have, in fact, been changed by the time mswsock.h is compiled.


Gambit 
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#21
Author: Remy Lebeau (TeamB)
Date: Fri, 28 Dec 2007 19:45
18 lines
1889 bytes
"Tom Byars" <tam118118@hotmail.com> wrote in message 
news:47754841$1@newsgroups.borland.com...

> This is line 208 in Idiohandler.hpp Remy.

The only way that line can produce an Integer overflow is if the compiler is 
treating 0xffffffffffffffff as an int instead of an __int64.  I don't know 
why Borland/CodeGear keeps having the Delphi compiler output signed values 
(in this case, -1) as unsigned hex values when generating an .hpp file. 
That is not very smart of them to do.  To avoid the warning, you will have 
to edit the file manually to say this instead:

    virtual void __fastcall ReadStream(Classes::TStream* AStream, __int64 
AByteCount = -1, bool AReadUntilDisconnect = false);


Gambit 
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#22
Author: Tom Byars
Date: Fri, 28 Dec 2007 22:25
22 lines
2155 bytes
Remy, I searched all my own files for "#define pascal" and "#define far" and 
found nothing. I then did the same for all files in the codegear directory. 
The only matches I found set pascal as _pascal and far as _far. So much for 
bcb 2007. Isn't OOP great. No need to reinvent the wheel when you can spend 
90% of your time trying to fix other peoples.

Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:477551c2$1@newsgroups.borland.com...
>
> "Tom Byars" <tam118118@hotmail.com> wrote in message 
> news:477546fd@newsgroups.borland.com...
>
>> Where would I find these redefinitions Remy?
>
> You will just have to search all of the header files that your project 
> uses. That is why I suggest you output their actual values first to see if 
> they have, in fact, been changed by the time mswsock.h is compiled.
>
>
> Gambit
>
> 
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#23
Author: Johannes Weinert
Date: Sat, 29 Dec 2007 10:51
46 lines
2622 bytes
Hello,

I'm not sure if it helps. If I create a new VCL project and #include 
<winsock2.h> and <mswsock.h> and preprocess unit1.cpp the typedef 
expands to:

typedef
INT
(__stdcall  * LPFN_WSARECVMSG) (
  SOCKET s,
   LPWSAMSG lpMsg,
        LPDWORD lpdwNumberOfBytesRecvd,
  LPWSAOVERLAPPED lpOverlapped,
  LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);

But I don't see where PASCAL='__stdcall' and FAR='' is defined.

HTH

Hans

Tom Byars wrote:
> Remy, I searched all my own files for "#define pascal" and "#define far" 
> and found nothing. I then did the same for all files in the codegear 
> directory. The only matches I found set pascal as _pascal and far as 
> _far. So much for bcb 2007. Isn't OOP great. No need to reinvent the 
> wheel when you can spend 90% of your time trying to fix other peoples.
> 
> Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
> news:477551c2$1@newsgroups.borland.com...
>>
>> "Tom Byars" <tam118118@hotmail.com> wrote in message 
>> news:477546fd@newsgroups.borland.com...
>>
>>> Where would I find these redefinitions Remy?
>>
>> You will just have to search all of the header files that your project 
>> uses. That is why I suggest you output their actual values first to 
>> see if they have, in fact, been changed by the time mswsock.h is 
>> compiled.
>>
>>
>> Gambit
>>
>>
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#24
Author: Tom Byars
Date: Sat, 29 Dec 2007 11:52
68 lines
3550 bytes
Hans, thanks for that. I've only just realised what 'Preprocess' means. The 
relevant part of the preprocessed file is as follows

typedef
(int((__stdcall  * LPFN_WSARECVMSG)+((__stdcall  * LPFN_WSARECVMSG)<0 ? -1 : 
1)*0.5))) (
SOCKET s,
LPWSAMSG lpMsg,
LPDWORD lpdwNumberOfBytesRecvd,
LPWSAOVERLAPPED lpOverlapped,
LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);

which looks a bit of a mess. All this is a bit over my head but, at a guess, 
would I be right in saying there are maybe files missing from a header. When 
I try to build the package I'm initially told "Unable to find package 
import: dss.bpi" and "Unable to find package import: ibsmp.bpi" (I clicked 
'Cancel' in respone to both). Is it something to do with that?


"Johannes Weinert" <jw_news@ddbst.de> wrote in message 
news:477626c9@newsgroups.borland.com...
> Hello,
>
> I'm not sure if it helps. If I create a new VCL project and #include 
> <winsock2.h> and <mswsock.h> and preprocess unit1.cpp the typedef expands 
> to:
>
> typedef
> INT
> (__stdcall  * LPFN_WSARECVMSG) (
>  SOCKET s,
>   LPWSAMSG lpMsg,
>        LPDWORD lpdwNumberOfBytesRecvd,
>  LPWSAOVERLAPPED lpOverlapped,
>  LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
> );
>
> But I don't see where PASCAL='__stdcall' and FAR='' is defined.
>
> HTH
>
> Hans
>
> Tom Byars wrote:
>> Remy, I searched all my own files for "#define pascal" and "#define far" 
>> and found nothing. I then did the same for all files in the codegear 
>> directory. The only matches I found set pascal as _pascal and far as 
>> _far. So much for bcb 2007. Isn't OOP great. No need to reinvent the 
>> wheel when you can spend 90% of your time trying to fix other peoples.
>>
>> Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
>> news:477551c2$1@newsgroups.borland.com...
>>>
>>> "Tom Byars" <tam118118@hotmail.com> wrote in message 
>>> news:477546fd@newsgroups.borland.com...
>>>
>>>> Where would I find these redefinitions Remy?
>>>
>>> You will just have to search all of the header files that your project 
>>> uses. That is why I suggest you output their actual values first to see 
>>> if they have, in fact, been changed by the time mswsock.h is compiled.
>>>
>>>
>>> Gambit
>>>
>>>
> 
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#26
Author: Tom Byars
Date: Wed, 02 Jan 2008 17:23
13 lines
1579 bytes
I can't find any trace of dss.bpi or ibsmp.bpi in the rad studio directory 
so I presume they're not required in bcb 2007. Apart from that can anyone 
explain how

typedef
INT

gets to

typedef
(int....

in the preprocessed file? Is INT itself macro substituted? 
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#27
Author: Remy Lebeau (TeamB)
Date: Wed, 02 Jan 2008 17:50
18 lines
1718 bytes
"Johannes Weinert" <jw_news@ddbst.de> wrote in message 
news:477626c9@newsgroups.borland.com...

> I'm not sure if it helps. If I create a new VCL project and
> #include <winsock2.h> and <mswsock.h> and preprocess
> unit1.cpp the typedef expands to:

I see no errors in that declaration.  If you are still having problems, then 
either INT, SOCKET, LPWSAMSG, LPWSAOVERLAPED, or 
LPWSAOVERLAPPED_COMPLETION_ROUTINE is undefined.

> But I don't see where PASCAL='__stdcall' and FAR='' is defined.

windef.h


Gambit 
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#28
Author: Remy Lebeau (TeamB)
Date: Wed, 02 Jan 2008 17:52
16 lines
1557 bytes
"Tom Byars" <tam118118@hotmail.com> wrote in message 
news:47763514@newsgroups.borland.com...

> (int((__stdcall  * LPFN_WSARECVMSG)+((__stdcall  * LPFN_WSARECVMSG)<0 ? -1 
> : 1)*0.5))) (

What is all that?

> which looks a bit of a mess.

It is.  There is no reason for the '+' or '?:' operators to be inside a 
declaration.


Gambit 
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#29
Author: Tom Byars
Date: Wed, 02 Jan 2008 19:20
28 lines
2087 bytes
> (int((__stdcall  * LPFN_WSARECVMSG)+((__stdcall  * LPFN_WSARECVMSG)<0 ? -1
>> : 1)*0.5))) (
>
> What is all that?

typedef
(int((__stdcall  * LPFN_WSARECVMSG)+((__stdcall  * LPFN_WSARECVMSG)<0 ? -1 :
1)*0.5))) (
SOCKET s,
LPWSAMSG lpMsg,
LPDWORD lpdwNumberOfBytesRecvd,
LPWSAOVERLAPPED lpOverlapped,
LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);

is what appears in the preprocessed file in place of

typedef
INT
(PASCAL FAR * LPFN_WSARECVMSG) (
    IN SOCKET s,
    IN OUT LPWSAMSG lpMsg,
    __out_opt LPDWORD lpdwNumberOfBytesRecvd,
    IN LPWSAOVERLAPPED lpOverlapped,
    IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
    );

 
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#30
Author: Tom Byars
Date: Wed, 02 Jan 2008 19:32
24 lines
2082 bytes
windef.h does feature in the preprocessed file.

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:477bcf51@newsgroups.borland.com...
>
> "Johannes Weinert" <jw_news@ddbst.de> wrote in message 
> news:477626c9@newsgroups.borland.com...
>
>> I'm not sure if it helps. If I create a new VCL project and
>> #include <winsock2.h> and <mswsock.h> and preprocess
>> unit1.cpp the typedef expands to:
>
> I see no errors in that declaration.  If you are still having problems, 
> then either INT, SOCKET, LPWSAMSG, LPWSAOVERLAPED, or 
> LPWSAOVERLAPPED_COMPLETION_ROUTINE is undefined.
>
>> But I don't see where PASCAL='__stdcall' and FAR='' is defined.
>
> windef.h
>
>
> Gambit
>
> 
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#33
Author: dhoke
Date: Tue, 08 Jan 2008 13:29
40 lines
2441 bytes
Do you have a macro "INT" defined somewhere in any of your stuff, possibly 
trying to round/truncate a value?

(Maybe with a definition something like:
"#define INT(x) (int((x)+((x)<0 ? -1 : 1)*0.5)"
)

"Tom Byars" <tam118118@hotmail.com> wrote in message 
news:477be405$1@newsgroups.borland.com...
>> (int((__stdcall  * LPFN_WSARECVMSG)+((__stdcall  * LPFN_WSARECVMSG)<0 
>> ? -1
>>> : 1)*0.5))) (
>>
>> What is all that?
>
> typedef
> (int((__stdcall  * LPFN_WSARECVMSG)+((__stdcall  * LPFN_WSARECVMSG)<0 ? -1 
> :
> 1)*0.5))) (
> SOCKET s,
> LPWSAMSG lpMsg,
> LPDWORD lpdwNumberOfBytesRecvd,
> LPWSAOVERLAPPED lpOverlapped,
> LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
> );
>
> is what appears in the preprocessed file in place of
>
> typedef
> INT
> (PASCAL FAR * LPFN_WSARECVMSG) (
>    IN SOCKET s,
>    IN OUT LPWSAMSG lpMsg,
>    __out_opt LPDWORD lpdwNumberOfBytesRecvd,
>    IN LPWSAOVERLAPPED lpOverlapped,
>    IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
>    );
>
>
> 
Re: mswsock.h & iosfwd prevent BCB6 project compiling using BCB 2007
#34
Author: Tom Byars
Date: Tue, 08 Jan 2008 17:53
48 lines
2906 bytes
dhoke, as soon as I saw your #define it all came flooding back. I had that 
identical line in my Constants.h file. Many thanks to you (I was all but 
ready to go back to BCB6) and apologies to everyone for wasting their time.

"dhoke" <dhoke.nojunk@east-shore.com> wrote in message 
news:47837a42$1@newsgroups.borland.com...
> Do you have a macro "INT" defined somewhere in any of your stuff, possibly 
> trying to round/truncate a value?
>
> (Maybe with a definition something like:
> "#define INT(x) (int((x)+((x)<0 ? -1 : 1)*0.5)"
> )
>
> "Tom Byars" <tam118118@hotmail.com> wrote in message 
> news:477be405$1@newsgroups.borland.com...
>>> (int((__stdcall  * LPFN_WSARECVMSG)+((__stdcall  * LPFN_WSARECVMSG)<0 
>>> ? -1
>>>> : 1)*0.5))) (
>>>
>>> What is all that?
>>
>> typedef
>> (int((__stdcall  * LPFN_WSARECVMSG)+((__stdcall  * LPFN_WSARECVMSG)<0 
>> ? -1 :
>> 1)*0.5))) (
>> SOCKET s,
>> LPWSAMSG lpMsg,
>> LPDWORD lpdwNumberOfBytesRecvd,
>> LPWSAOVERLAPPED lpOverlapped,
>> LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
>> );
>>
>> is what appears in the preprocessed file in place of
>>
>> typedef
>> INT
>> (PASCAL FAR * LPFN_WSARECVMSG) (
>>    IN SOCKET s,
>>    IN OUT LPWSAMSG lpMsg,
>>    __out_opt LPDWORD lpdwNumberOfBytesRecvd,
>>    IN LPWSAOVERLAPPED lpOverlapped,
>>    IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
>>    );
>>
>>
>>
>
> 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads