Skip to content

Commit

Permalink
Compatibility improvements for QNX.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35451 72102866-910b-0410-8b05-ffd578937521
  • Loading branch information
ngrewe committed Aug 26, 2012
1 parent 1e852b2 commit a99a516
Show file tree
Hide file tree
Showing 13 changed files with 3,130 additions and 2,336 deletions.
21 changes: 21 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
2012-08-26 Niels Grewe <[email protected]>

* configure.ac: Check for sys/filio.h and whether we need to
link libsocket (as on QNX).
* configure
* SSL/configure
* Headers/GNUstepBase/config.h.in:
Regenerate.
* Source/common.h
* Source/GSFileHandle.m
* Source/NSMessagePort.m
* Source/NSSocketPort.m
* Source/NSThread.m
* SSL/GSSSLHandle.m:
QNX compatibility tweaks.
* Tools/gdnc.m
* Tools/gdomap.c:
Use slog facility for logging on QNX.

Compatibility improvements for building for QNX.

2012-08-26 Niels Grewe <[email protected]>

* configure.ac: Check for QNX slog facilities.
Expand Down
9 changes: 9 additions & 0 deletions Headers/GNUstepBase/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@
/* Define to 1 if you have the `gethostbyaddr_r' function. */
#undef HAVE_GETHOSTBYADDR_R

/* Define to 1 if you have the `gethostbyname' function. */
#undef HAVE_GETHOSTBYNAME

/* Define to 1 if you have the `getlogin' function. */
#undef HAVE_GETLOGIN

Expand Down Expand Up @@ -337,6 +340,9 @@
/* Define to 1 if you have the `rt' library (-lrt). */
#undef HAVE_LIBRT

/* Define to 1 if you have the `socket' library (-lsocket). */
#undef HAVE_LIBSOCKET

/* Define if libxml available */
#undef HAVE_LIBXML

Expand Down Expand Up @@ -539,6 +545,9 @@
/* Define to 1 if you have the <sys/file.h> header file. */
#undef HAVE_SYS_FILE_H

/* Define to 1 if you have the <sys/filio.h> header file. */
#undef HAVE_SYS_FILIO_H

/* Define to 1 if you have the <sys/inttypes.h> header file. */
#undef HAVE_SYS_INTTYPES_H

Expand Down
32 changes: 17 additions & 15 deletions SSL/GSSSLHandle.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@

#include <sys/ioctl.h>
#ifdef __svr4__
#ifdef HAVE_SYS_FILIO_H
#include <sys/filio.h>
#endif
#endif
#include <netdb.h>
#include <string.h>

Expand Down Expand Up @@ -130,30 +132,30 @@
static NSLock **locks = 0;

static void
locking_function(int mode, int n, const char *file, int line)
{
locking_function(int mode, int n, const char *file, int line)
{
if (mode & CRYPTO_LOCK)
{
{
[locks[n] lock];
}
else
{
{
[locks[n] unlock];
}
}
}
}

#if defined(HAVE_CRYPTO_THREADID_SET_CALLBACK)
static void
threadid_function(CRYPTO_THREADID *ref)
{
threadid_function(CRYPTO_THREADID *ref)
{
CRYPTO_THREADID_set_pointer(ref, GSCurrentThread());
}
}
#else
static unsigned long
threadid_function()
{
threadid_function()
{
return (unsigned long) GSCurrentThread();
}
}
#endif


Expand Down Expand Up @@ -200,11 +202,11 @@ + (void) initialize
{
locks[count] = [NSLock new];
}
CRYPTO_set_locking_callback(locking_function);
CRYPTO_set_locking_callback(locking_function);
#if defined(HAVE_CRYPTO_THREADID_SET_CALLBACK)
CRYPTO_THREADID_set_callback(threadid_function);
CRYPTO_THREADID_set_callback(threadid_function);
#else
CRYPTO_set_id_callback(threadid_function);
CRYPTO_set_id_callback(threadid_function);
#endif

/*
Expand Down
Loading

0 comments on commit a99a516

Please sign in to comment.