source modifications to allow compilation on solaris

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@15 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
imaginos
2004-08-24 22:53:37 +00:00
parent 2a725fde45
commit abb61af25f
2 changed files with 33 additions and 0 deletions
+9
View File
@@ -51,6 +51,11 @@
#include <sys/ioctl.h>
#include <sys/timeb.h>
#ifdef __sun
#include <strings.h>
#include <fcntl.h>
#endif /* __sun */
#ifdef HAVE_LIBSSL
#include <openssl/ssl.h>
#include <openssl/err.h>
@@ -121,12 +126,16 @@ namespace Csocket
inline void __Perror( const CS_STRING & s )
{
#ifdef __sun
CS_DEBUG( s << ": " << strerror( errno ) );
#else
char buff[512];
memset( (char *)buff, '\0', 512 );
if ( strerror_r( errno, buff, 511 ) == 0 )
CS_DEBUG( s << ": " << buff );
else
CS_DEBUG( s << ": Unknown Error Occured" );
#endif /* __sun */
}
inline unsigned long long millitime()
{
+24
View File
@@ -11,6 +11,30 @@ using std::stringstream;
CUtils::CUtils() {}
CUtils::~CUtils() {}
#ifdef __sun
char *strcasestr(const char *big, const char *little)
{
int len;
if (!little || !big || !little[0])
return (char *) big;
len = strlen(little);
while (*big)
{
if (tolower(*big) == tolower(*little))
{
if (strncasecmp(big, little, len) == 0)
return (char *) big;
}
big++;
}
return NULL;
}
#endif /* __sun */
string CUtils::GetIP(unsigned long addr) {
char szBuf[16];
memset((char*) szBuf, 0, 16);