no prototype in C, not (void) like in C++) to take (void) instead.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6675
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
/* Global initializers */
/* GSocket_Init() must be called at the beginning */
/* Global initializers */
/* GSocket_Init() must be called at the beginning */
+bool GSocket_Init(void);
/* GSocket_Cleanup() must be called at the end */
/* GSocket_Cleanup() must be called at the end */
+void GSocket_Cleanup(void);
/* Constructors / Destructors */
/* Constructors / Destructors */
+GSocket *GSocket_new(void);
void GSocket_destroy(GSocket *socket);
void GSocket_destroy(GSocket *socket);
-GAddress *GAddress_new();
+GAddress *GAddress_new(void);
GAddress *GAddress_copy(GAddress *address);
void GAddress_destroy(GAddress *address);
GAddress *GAddress_copy(GAddress *address);
void GAddress_destroy(GAddress *address);
#define SOCKLEN_T int
#endif
#define SOCKLEN_T int
#endif
-#if defined(__BORLANDC__)
-GAddress *GAddress_new(void);
-GSocket *GSocket_new(void);
-#endif
-
#ifdef _MSC_VER
/* using FD_SET results in this warning */
#pragma warning(disable:4127) /* conditional expression is constant */
#ifdef _MSC_VER
/* using FD_SET results in this warning */
#pragma warning(disable:4127) /* conditional expression is constant */
/* Constructors / Destructors for GSocket */
/* Constructors / Destructors for GSocket */
+GSocket *GSocket_new(void)
{
int i;
GSocket *socket;
{
int i;
GSocket *socket;
-GAddress *GAddress_new()
+GAddress *GAddress_new(void)
/* Global initialisers */
/* Global initialisers */
+void GSocket_Cleanup(void)
{
}
/* Constructors / Destructors for GSocket */
{
}
/* Constructors / Destructors for GSocket */
+GSocket *GSocket_new(void)
{
int i;
GSocket *socket;
{
int i;
GSocket *socket;
/* 10 minutes * 60 sec * 1000 millisec */
socket->m_establishing = FALSE;
/* 10 minutes * 60 sec * 1000 millisec */
socket->m_establishing = FALSE;
- /* We initialize the GUI specific entries here */
- _GSocket_GUI_Init(socket);
+ /* Per-socket GUI-specific initialization */
+ if (!_GSocket_GUI_Init(socket))
+ {
+ free(socket);
+ return NULL;
+ }
{
assert(socket != NULL);
{
assert(socket != NULL);
+ /* Per-socket GUI-specific cleanup */
+ _GSocket_GUI_Destroy(socket);
+
/* Check that the socket is really shutdowned */
if (socket->m_fd != -1)
GSocket_Shutdown(socket);
/* Check that the socket is really shutdowned */
if (socket->m_fd != -1)
GSocket_Shutdown(socket);
- /* We destroy GUI specific variables */
- _GSocket_GUI_Destroy(socket);
-
/* Destroy private addresses */
if (socket->m_local)
GAddress_destroy(socket->m_local);
/* Destroy private addresses */
if (socket->m_local)
GAddress_destroy(socket->m_local);
-GAddress *GAddress_new()
+GAddress *GAddress_new(void)