Make of dawn1.69r

Posted by Wraithian on Thu 20 Jan 2005 12:34 PM — 5 posts, 29,472 views.

USA #0
results of make 2> make-errors follow:
Quote:
connect.cpp: In member function `void connection_data::close_socket()':
connect.cpp:214: error: parse error before `{' token
connect.cpp: At global scope:
connect.cpp:221: error: ISO C++ forbids declaration of `connected_socket' with
no type
connect.cpp:222: error: parse error before `}' token
make: *** [connect.o] Error 1


Any clues? I have zlib... heck, I have everything (I had the luxury of being able to just plop everything onto my installation).
USA #1
Can you show us the lines displayed in the errors?
USA #2
Here's lines 209 to 217 (extra lines are for reference, comments are removed). This block applies to the error:
Quote:
connect.cpp: In member function `void connection_data::close_socket()':
connect.cpp:214: error: parse error before `{' token


#ifdef __CYGWIN__
	if(shutdown(connected_socket, 2)!=0{
		logf("error %d calling shutdown on socket %d.", errno, connected_socket);
	}
#endif





Lines 221 and 222 reguarding the following make errors:
Quote:
connect.cpp: At global scope:
connect.cpp:221: error: ISO C++ forbids declaration of `connected_socket' with
no type
connect.cpp:222: error: parse error before `}' token


if (closesocket(connected_socket )!=0){
		socket_error(FORMATF("connection_data::close_socket(): error calling closesocket() on socket %d",connected_socket));
	}
	connected_socket=0;
}

USA #3
Quote:
#ifdef __CYGWIN__
	if(shutdown(connected_socket, 2)!=0{
		logf("error %d calling shutdown on socket %d.", errno, connected_socket);
	}
#endif
Well, here it's pretty straightforward: you're missing a parenthesis before the open-bracket.
Quote:
if (closesocket(connected_socket )!=0){
		socket_error(FORMATF("connection_data::close_socket(): error calling closesocket() on socket %d",connected_socket));
	}
	connected_socket=0;
}
I'm not sure what the problem is here. Apparently it doesn't know what 'connected_socket' is. Since your brackets are unbalanced, I'm assuming there's a lot more to the code than what you pasted; could you show the full block?
USA #4
Well, I am getting the same error, so here goes.

/**************************************************************************/
// close the actual socket attached to a connection structure
void connection_data::close_socket()
{
	logf("Closing socket %d", connected_socket);
#ifdef __CYGWIN__
	// a hack to make cygwin shutdown sockets after a hotreboot
	// cygwin still appears to be leaking endpoints according to 
	// processexplorer from sysinternals, but this atleast gets
	// the socket to disconnect.
	if(shutdown(connected_socket, 2)!=0{
		logf("error %d calling shutdown on socket %d.", errno, connected_socket);
	}
#endif
	if (closesocket(connected_socket )!=0){
		socket_error(FORMATF("connection_data::close_socket(): error calling closesocket() on socket %d",connected_socket));
	}
	connected_socket=0;
}
/**************************************************************************/

There is the full block of code.