Error in Winsock.bi

For other topics related to the FreeBASIC project or its community.
RockTheSchock
Posts: 218
Joined: Mar 12, 2006 16:25

Error in Winsock.bi

Postby RockTheSchock » May 22, 2015 11:36

I tried EGNP/ TSNE and found some errors in winsock.bi. It seems to be a regression in preprocessor.

Sizeof((t)) with 2 parenthesis doesnt work anymore:

Code: Select all

#Define _A(t) (CLng(sizeof((t))) )
Screen 0
#Print _A(ULong)
Print _A(Ulong)

Sleep


In winsock.bi you will need to fix sizeof((t)) with sizeof(t)

Code: Select all

#define _IOR(x, y, t) ...
#define _IOW(x, y, t)...


Then there are missing OpenSocket, Selectsocket. I added the 2 lines to TSNE_v3.bi. Maybe not optimal.

Code: Select all

#define OpenSocket Socket
#Define Selectsocket select_


Then I replaced in EGNP.bi all occurences of V_INT by V_INTEG.
EGNP / TSNE should use it's own namespace to avoid duplicated definition errors. But changing that is another task.
dkl
Site Admin
Posts: 3202
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Error in Winsock.bi

Postby dkl » May 23, 2015 19:45

Hi,

both the sizeof() issue and the missing #defines should be fixed in Git now. Thanks for reporting. The former was a bug in the translation process (too many parentheses), the latter looks like an FB-specific extension of the Windows API headers that was lost when the new binding was made.

Return to “Community Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests