We probably shouldn't be exporting something called wsockinit() at all,
as it's too likely to collide with routines in code that calls us. I
don't know whether Wine implemented it in order to run Windows programs
that call it, or if there actually *are* such programs, but we'll leave
it around for now.
Call pcap_wsockinit() in pcap_compile(), and don't bother declaring it;
rely on it being declared in pcap-int.h, so we run less of a risk of the
declaration and definition getting out of sync (not that we're likely to
change its signature, but...).
In the definitions of it and wsockinit(), explicitly note that they take
no arguments.
* a separate -lpthread, we might not want to do that.
*/
#ifdef _WIN32
- extern int wsockinit (void);
static int done = 0;
if (!done)
- wsockinit();
+ pcap_wsockinit();
done = 1;
EnterCriticalSection(&g_PcapCompileCriticalSection);
#endif
#ifdef _WIN32
void pcap_win32_err_to_str(DWORD, char *);
+void pcap_wsockinit (void);
#endif
int install_bpf_program(pcap_t *, struct bpf_program *);
/* Start winsock */
int
-wsockinit()
+wsockinit(void)
{
WORD wVersionRequested;
WSADATA wsaData;
return err;
}
-int pcap_wsockinit()
+int
+pcap_wsockinit(void)
{
return wsockinit();
}