mirror of
https://github.com/znc/znc.git
synced 2026-08-07 01:13:25 +02:00
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:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user