2
0
mirror of https://github.com/xcat2/xNBA.git synced 2025-04-16 18:19:25 +00:00

Mildly ugly hack to force correct linkage.

This commit is contained in:
Michael Brown 2007-06-28 18:06:25 +01:00
parent e4c9c91d6e
commit 5de837cc67
3 changed files with 20 additions and 6 deletions

View File

@ -12,8 +12,15 @@
*
* @{
*/
#define SOCK_STREAM 1 /**< Connection-based, reliable streams */
#define SOCK_DGRAM 2 /**< Connectionless, unreliable streams */
/** Connection-based, reliable streams */
#define SOCK_STREAM ( ( int ) TCP_SOCK_STREAM )
extern char TCP_SOCK_STREAM[];
/** Connectionless, unreliable streams */
#define SOCK_DGRAM ( ( int ) UDP_SOCK_DGRAM )
extern char UDP_SOCK_DGRAM[];
/** @} */
/**
@ -24,10 +31,13 @@
*/
static inline __attribute__ (( always_inline )) const char *
socket_semantics_name ( int semantics ) {
switch ( semantics ) {
case SOCK_STREAM: return "SOCK_STREAM";
case SOCK_DGRAM: return "SOCK_DGRAM";
default: return "SOCK_UNKNOWN";
/* Cannot use a switch() because of the {TCP_UDP}_SOCK_XXX hack */
if ( semantics == SOCK_STREAM ) {
return "SOCK_STREAM";
} else if ( semantics == SOCK_DGRAM ) {
return "SOCK_DGRAM";
} else {
return "SOCK_UNKNOWN";
}
}

View File

@ -973,6 +973,8 @@ struct socket_opener tcp_socket_opener __socket_opener = {
.open = tcp_open,
};
char TCP_SOCK_STREAM[1];
/**
* Open TCP URI
*

View File

@ -436,6 +436,8 @@ struct socket_opener udp_socket_opener __socket_opener = {
.open = udp_open,
};
char UDP_SOCK_DGRAM[1];
/**
* Open UDP URI
*