The MASM Forum

General => The Campus => Topic started by: Brannagan on July 19, 2014, 03:00:47 AM

Title: Where are the select macros (FD_SET, FD_ZERO, etc)?
Post by: Brannagan on July 19, 2014, 03:00:47 AM
I'm trying to use the select function with MASM32, but I'm getting error messages like these:

error A2006: undefined symbol : FD_SET
error A2006: undefined symbol : FD_ZERO
error A2006: undefined symbol : select

Can anyone tell me if these are defined in any include file, or how to add them manually?

http://msdn.microsoft.com/en-us/library/windows/desktop/ms740142(v=vs.85).aspx
Title: Re: Where are the select macros (FD_SET, FD_ZERO, etc)?
Post by: dedndave on July 19, 2014, 05:29:40 AM
i don't see them
but - it's a simple variable length array of dwords, i guess
the first dword holds a count, which tells you how many additional dwords there are in the array
Title: Re: Where are the select macros (FD_SET, FD_ZERO, etc)?
Post by: MichaelW on July 19, 2014, 06:47:29 AM
Try the Microsoft WinSock2.h header file, probably available with Visual Studio and with at least some of the available PSDKs.
Title: Re: Where are the select macros (FD_SET, FD_ZERO, etc)?
Post by: Tedd on July 22, 2014, 12:56:24 AM
The 'select' function is defined in "ws2_32.inc" (there's also one in "wsock32.inc").
The 'fd_set' structure is defined in "windows.inc".

The macros, unfortunately, are not. They're actually implemented as inline 'functions' so you'll need to write your own (either as separate functions, or inlined with macros); luckily they are quite simple.