8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 16:43:03 +01:00

[build] [cmake] Prepare sources for CMake building. Add clang preprocessor defs, ARM architecture defs, some Android-related defs. Add 'qsort_r' function search to configure.ac.

This commit is contained in:
egorpugin 2015-01-21 11:11:04 +00:00
parent 8216554413
commit d397e68a48
9 changed files with 25 additions and 2 deletions

View File

@ -854,6 +854,7 @@ AC_CHECK_FUNCS(fchmod)
AC_CHECK_FUNCS(semtimedop)
AC_CHECK_FUNCS(fegetenv)
AC_CHECK_FUNCS(strerror_r)
AC_CHECK_FUNCS(qsort_r)
case $host in
*-darwin*)
ac_cv_func_fdatasync=no

View File

@ -220,6 +220,9 @@
#define UNIX
#define FB_OS OsDarwin
#ifdef ARM
#define FB_CPU CpuArm
#endif /* ARM */
#ifdef __ppc__
#define powerpc
#define FB_CPU CpuPowerPc

View File

@ -112,12 +112,14 @@ static int process_id;
#include <sys/param.h>
#endif
#ifndef WIN_NT
#ifndef HAVE_GETPAGESIZE
static size_t getpagesize()
{
return PAGESIZE;
}
#endif
#endif
//#define DEBUG_IPC
#ifdef DEBUG_IPC

View File

@ -125,6 +125,9 @@
#if defined(__ppc__) || defined(__ppc64__)
#define FB_PLATFORM "UP" // Darwin/PowerPC
#endif
#if defined(ARM)
#define FB_PLATFORM "UA"
#endif
#endif // DARWIN
#ifndef FB_VERSION

View File

@ -65,7 +65,11 @@ namespace
void qsort_ctx(void* base, size_t count, size_t width, qsort_compare_callback compare, void* arg)
{
#if defined(LINUX)
#ifdef HAVE_QSORT_R
qsort_r(base, count, width, compare, arg);
#else
#undef USE_QSORT_CTX
#endif
#elif defined(WIN_NT)
struct qsort_ctx_data tmp = {arg, compare};
qsort_s(base, count, width, &qsort_ctx_arg_swap, &tmp);

View File

@ -799,7 +799,7 @@ rem_port* INET_connect(const TEXT* name,
gai_hints.ai_family = ((packet || host.hasData() || !ipv6) ? AF_UNSPEC : AF_INET6);
gai_hints.ai_socktype = SOCK_STREAM;
#ifndef WIN_NT
#if !defined(WIN_NT) && !defined(__clang__)
gai_hints.ai_protocol = SOL_TCP;
#else
gai_hints.ai_protocol = IPPROTO_TCP;

View File

@ -95,7 +95,8 @@ enum P_ARCH
arch_winnt_64 = 40,
arch_darwin_x64 = 41,
arch_darwin_ppc64 = 42,
arch_max = 43 // Keep this at the end
arch_arm = 43,
arch_max = 44 // Keep this at the end
};
// Protocol Types

View File

@ -70,6 +70,8 @@ const P_ARCH ARCHITECTURE = arch_intel_32;
const P_ARCH ARCHITECTURE = arch_darwin_x64;
#elif defined(DARWINPPC64)
const P_ARCH ARCHITECTURE = arch_darwin_ppc64;
#elif defined(ARM)
const P_ARCH ARCHITECTURE = arch_arm;
#endif

View File

@ -28,6 +28,13 @@
#include "PluginLogWriter.h"
#include "../common/classes/init.h"
#ifndef S_IREAD
#define S_IREAD S_IRUSR
#endif
#ifndef S_IWRITE
#define S_IWRITE S_IWUSR
#endif
using namespace Firebird;
// seems to only be Solaris 9 that doesn't have strerror_r,