mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel-solaris' of https://github.com/doublerebel/arangodb into doublerebel-devel-solaris
Fix Conflicts: arangod/FulltextIndex/fulltext-index.cpp lib/Basics/logging.cpp
This commit is contained in:
commit
acc17daa96
|
@ -9,6 +9,7 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
BUILT_SOURCES += @LIBEV_LIBS@
|
BUILT_SOURCES += @LIBEV_LIBS@
|
||||||
|
LIBEV_FLAGS = @LIBEV_FLAGS@
|
||||||
|
|
||||||
@LIBEV_LIBS@: @srcdir@/.libev-build-@TRI_BITS@
|
@LIBEV_LIBS@: @srcdir@/.libev-build-@TRI_BITS@
|
||||||
|
|
||||||
|
@ -21,7 +22,7 @@ BUILT_SOURCES += @LIBEV_LIBS@
|
||||||
|
|
||||||
mkdir @top_srcdir@/3rdParty/libev/BUILD || true
|
mkdir @top_srcdir@/3rdParty/libev/BUILD || true
|
||||||
cd @top_srcdir@/3rdParty/libev/BUILD && CC="$(CC)" CFLAGS="" ../configure --disable-shared
|
cd @top_srcdir@/3rdParty/libev/BUILD && CC="$(CC)" CFLAGS="" ../configure --disable-shared
|
||||||
cd @top_srcdir@/3rdParty/libev/BUILD && $(MAKE) CFLAGS="-D EV_CHILD_ENABLE=0"
|
cd @top_srcdir@/3rdParty/libev/BUILD && $(MAKE) CFLAGS="-D EV_CHILD_ENABLE=0 $(LIBEV_FLAGS)"
|
||||||
|
|
||||||
touch @srcdir@/.libev-build-@TRI_BITS@
|
touch @srcdir@/.libev-build-@TRI_BITS@
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,8 @@ V8DIR=@V8_DIR@
|
||||||
if ENABLE_ARMV6
|
if ENABLE_ARMV6
|
||||||
if ENABLE_V8_DEBUG
|
if ENABLE_V8_DEBUG
|
||||||
cd @top_srcdir@/3rdParty/$(V8DIR) \
|
cd @top_srcdir@/3rdParty/$(V8DIR) \
|
||||||
export GYPFLAGS="-Darm_fpu=vfp -Darm_version=6 -Dstandalone_static_library=1 $(GOLD_V8_GYP)" \
|
&& export GYPFLAGS="-Darm_fpu=vfp -Darm_version=6 -Dstandalone_static_library=1 $(GOLD_V8_GYP)" \
|
||||||
&& $(MAKE) \
|
&& $(MAKE) \
|
||||||
CC="$(CC)" \
|
CC="$(CC)" \
|
||||||
CC.host="$(CC)" \
|
CC.host="$(CC)" \
|
||||||
CXX="$(CXX)" \
|
CXX="$(CXX)" \
|
||||||
|
@ -58,8 +58,8 @@ if ENABLE_V8_DEBUG
|
||||||
library=static strictaliasing=off snapshot=off werror=no hardfp=on @V8_TARGET@
|
library=static strictaliasing=off snapshot=off werror=no hardfp=on @V8_TARGET@
|
||||||
else
|
else
|
||||||
cd @top_srcdir@/3rdParty/$(V8DIR) \
|
cd @top_srcdir@/3rdParty/$(V8DIR) \
|
||||||
export GYPFLAGS="-Darm_fpu=vfp -Darm_version=6 -Dstandalone_static_library=1 $(GOLD_V8_GYP)" \
|
&& export GYPFLAGS="-Darm_fpu=vfp -Darm_version=6 -Dstandalone_static_library=1 $(GOLD_V8_GYP)" \
|
||||||
&& $(MAKE) \
|
&& $(MAKE) \
|
||||||
CC="$(CC)" \
|
CC="$(CC)" \
|
||||||
CC.host="$(CC)" \
|
CC.host="$(CC)" \
|
||||||
CXX="$(CXX)" \
|
CXX="$(CXX)" \
|
||||||
|
@ -79,8 +79,8 @@ else # ! ENABLE_ARM6
|
||||||
if ENABLE_ARMV7
|
if ENABLE_ARMV7
|
||||||
if ENABLE_V8_DEBUG
|
if ENABLE_V8_DEBUG
|
||||||
cd @top_srcdir@/3rdParty/$(V8DIR) \
|
cd @top_srcdir@/3rdParty/$(V8DIR) \
|
||||||
export GYPFLAGS="-Darm_fpu=vfp -Darm_version=6 -Dstandalone_static_library=1 $(GOLD_V8_GYP)" \
|
&& export GYPFLAGS="-Darm_fpu=vfp -Darm_version=6 -Dstandalone_static_library=1 $(GOLD_V8_GYP)" \
|
||||||
&& $(MAKE) \
|
&& $(MAKE) \
|
||||||
CC="$(CC)" \
|
CC="$(CC)" \
|
||||||
CC.host="$(CC)" \
|
CC.host="$(CC)" \
|
||||||
CXX="$(CXX)" \
|
CXX="$(CXX)" \
|
||||||
|
@ -93,8 +93,8 @@ if ENABLE_V8_DEBUG
|
||||||
library=static strictaliasing=off snapshot=off werror=no @V8_TARGET@
|
library=static strictaliasing=off snapshot=off werror=no @V8_TARGET@
|
||||||
else
|
else
|
||||||
cd @top_srcdir@/3rdParty/$(V8DIR) \
|
cd @top_srcdir@/3rdParty/$(V8DIR) \
|
||||||
export GYPFLAGS=" -Darm_version=7 -Dstandalone_static_library=1 $(GOLD_V8_GYP)" \
|
&& export GYPFLAGS=" -Darm_version=7 -Dstandalone_static_library=1 $(GOLD_V8_GYP)" \
|
||||||
&& $(MAKE) \
|
&& $(MAKE) \
|
||||||
CC="$(CC)" \
|
CC="$(CC)" \
|
||||||
CC.host="$(CC)" \
|
CC.host="$(CC)" \
|
||||||
CXX="$(CXX)" \
|
CXX="$(CXX)" \
|
||||||
|
@ -114,8 +114,8 @@ else # ! ENABLE_ARM7
|
||||||
if ENABLE_DARWIN
|
if ENABLE_DARWIN
|
||||||
if ENABLE_V8_DEBUG
|
if ENABLE_V8_DEBUG
|
||||||
cd @top_srcdir@/3rdParty/$(V8DIR) \
|
cd @top_srcdir@/3rdParty/$(V8DIR) \
|
||||||
export GYPFLAGS="-Dstandalone_static_library=1 $(GOLD_V8_GYP)" \
|
&& export GYPFLAGS="-Dstandalone_static_library=1 $(GOLD_V8_GYP)" \
|
||||||
&& $(MAKE) \
|
&& $(MAKE) \
|
||||||
CC="$(CC)" \
|
CC="$(CC)" \
|
||||||
CC.host="$(CC)" \
|
CC.host="$(CC)" \
|
||||||
CXX="$(CXX)" \
|
CXX="$(CXX)" \
|
||||||
|
@ -133,8 +133,8 @@ if ENABLE_V8_DEBUG
|
||||||
|
|
||||||
else # ! ENABLE_V8_DEBUG
|
else # ! ENABLE_V8_DEBUG
|
||||||
cd @top_srcdir@/3rdParty/$(V8DIR) \
|
cd @top_srcdir@/3rdParty/$(V8DIR) \
|
||||||
export GYPFLAGS="-Dstandalone_static_library=1 $(GOLD_V8_GYP)" \
|
&& export GYPFLAGS="-Dstandalone_static_library=1 $(GOLD_V8_GYP)" \
|
||||||
&& $(MAKE) \
|
&& $(MAKE) \
|
||||||
CC="$(CC)" \
|
CC="$(CC)" \
|
||||||
CC.host="$(CC)" \
|
CC.host="$(CC)" \
|
||||||
CXX="$(CXX)" \
|
CXX="$(CXX)" \
|
||||||
|
@ -153,8 +153,8 @@ endif # ENABLE_V8_DEBUG
|
||||||
else # ! ENABLE_DARWIN
|
else # ! ENABLE_DARWIN
|
||||||
if ENABLE_V8_DEBUG
|
if ENABLE_V8_DEBUG
|
||||||
cd @top_srcdir@/3rdParty/$(V8DIR) \
|
cd @top_srcdir@/3rdParty/$(V8DIR) \
|
||||||
export GYPFLAGS="-Dstandalone_static_library=1 $(GOLD_V8_GYP)" \
|
&& export GYPFLAGS="-Dstandalone_static_library=1 $(GOLD_V8_GYP)" \
|
||||||
&& $(MAKE) \
|
&& $(MAKE) \
|
||||||
CC="$(CC)" \
|
CC="$(CC)" \
|
||||||
CC.host="$(CC)" \
|
CC.host="$(CC)" \
|
||||||
CXX="$(CXX)" \
|
CXX="$(CXX)" \
|
||||||
|
@ -166,8 +166,8 @@ if ENABLE_V8_DEBUG
|
||||||
library=static strictaliasing=off snapshot=off werror=no @V8_TARGET@
|
library=static strictaliasing=off snapshot=off werror=no @V8_TARGET@
|
||||||
else # ! ENABLE_V8_DEBUG
|
else # ! ENABLE_V8_DEBUG
|
||||||
cd @top_srcdir@/3rdParty/$(V8DIR) \
|
cd @top_srcdir@/3rdParty/$(V8DIR) \
|
||||||
export GYPFLAGS="-Dstandalone_static_library=1 $(GOLD_V8_GYP)" \
|
&& export GYPFLAGS="-Dstandalone_static_library=1 $(GOLD_V8_GYP)" \
|
||||||
&& $(MAKE) \
|
&& $(MAKE) \
|
||||||
CC="$(CC)" \
|
CC="$(CC)" \
|
||||||
CC.host="$(CC)" \
|
CC.host="$(CC)" \
|
||||||
CXX="$(CXX)" \
|
CXX="$(CXX)" \
|
||||||
|
|
|
@ -191,6 +191,7 @@ struct bit_hash : public std::unary_function<T, size_t> {};
|
||||||
struct bit_equal_to<type> : public std::equal_to<type> {}; \
|
struct bit_equal_to<type> : public std::equal_to<type> {}; \
|
||||||
template <> \
|
template <> \
|
||||||
struct bit_hash<type> : public hash<type> {};
|
struct bit_hash<type> : public hash<type> {};
|
||||||
|
V8_BASE_BIT_SPECIALIZE_TRIVIAL(char)
|
||||||
V8_BASE_BIT_SPECIALIZE_TRIVIAL(signed char)
|
V8_BASE_BIT_SPECIALIZE_TRIVIAL(signed char)
|
||||||
V8_BASE_BIT_SPECIALIZE_TRIVIAL(unsigned char)
|
V8_BASE_BIT_SPECIALIZE_TRIVIAL(unsigned char)
|
||||||
V8_BASE_BIT_SPECIALIZE_TRIVIAL(short) // NOLINT(runtime/int)
|
V8_BASE_BIT_SPECIALIZE_TRIVIAL(short) // NOLINT(runtime/int)
|
||||||
|
|
|
@ -42,8 +42,10 @@
|
||||||
* and define _XOPEN_SOURCE to different values depending on __STDC_VERSION__.
|
* and define _XOPEN_SOURCE to different values depending on __STDC_VERSION__.
|
||||||
* In C++ source code (e.g., putil.cpp), __STDC_VERSION__ is not defined at all.
|
* In C++ source code (e.g., putil.cpp), __STDC_VERSION__ is not defined at all.
|
||||||
*/
|
*/
|
||||||
|
#if !defined(_SCO_DS)
|
||||||
# define _XOPEN_SOURCE 600
|
# define _XOPEN_SOURCE 600
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make sure things like readlink and such functions work.
|
* Make sure things like readlink and such functions work.
|
||||||
|
@ -52,9 +54,11 @@
|
||||||
*
|
*
|
||||||
* z/OS needs this definition for timeval and to get usleep.
|
* z/OS needs this definition for timeval and to get usleep.
|
||||||
*/
|
*/
|
||||||
|
#if !defined(__sun) && !defined(_SCO_DS)
|
||||||
#if !defined(_XOPEN_SOURCE_EXTENDED)
|
#if !defined(_XOPEN_SOURCE_EXTENDED)
|
||||||
# define _XOPEN_SOURCE_EXTENDED 1
|
# define _XOPEN_SOURCE_EXTENDED 1
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* There is an issue with turning on _XOPEN_SOURCE_EXTENDED on certain platforms.
|
* There is an issue with turning on _XOPEN_SOURCE_EXTENDED on certain platforms.
|
||||||
|
|
|
@ -23,7 +23,7 @@ LD_RPATH= -R'$$'ORIGIN
|
||||||
LD_RPATH_PRE= -R
|
LD_RPATH_PRE= -R
|
||||||
|
|
||||||
## Compiler switch to embed a library name
|
## Compiler switch to embed a library name
|
||||||
LD_SONAME = -h $(notdir $(MIDDLE_SO_TARGET))
|
LD_SONAME = -Wl,-h,$(notdir $(MIDDLE_SO_TARGET))
|
||||||
|
|
||||||
## Shared library options
|
## Shared library options
|
||||||
LD_SOOPTIONS= -Wl,-Bsymbolic
|
LD_SOOPTIONS= -Wl,-Bsymbolic
|
||||||
|
|
|
@ -193,5 +193,5 @@ double SortNode::estimateCost(size_t& nrItems) const {
|
||||||
if (nrItems <= 3.0) {
|
if (nrItems <= 3.0) {
|
||||||
return depCost + nrItems;
|
return depCost + nrItems;
|
||||||
}
|
}
|
||||||
return depCost + nrItems * log(nrItems);
|
return depCost + nrItems * log(static_cast<double>(nrItems));
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,7 @@ typedef struct {
|
||||||
|
|
||||||
uint32_t _nodeChunkSize; // how many sub-nodes to allocate per chunk
|
uint32_t _nodeChunkSize; // how many sub-nodes to allocate per chunk
|
||||||
uint32_t _initialNodeHandles; // how many handles to allocate per node
|
uint32_t _initialNodeHandles; // how many handles to allocate per node
|
||||||
} index_t;
|
} index__t;
|
||||||
|
|
||||||
static uint32_t NodeNumFollowers(const node_t* const);
|
static uint32_t NodeNumFollowers(const node_t* const);
|
||||||
|
|
||||||
|
@ -125,9 +125,9 @@ static node_char_t* NodeFollowersKeys(const node_t* const);
|
||||||
|
|
||||||
static node_t** NodeFollowersNodes(const node_t* const);
|
static node_t** NodeFollowersNodes(const node_t* const);
|
||||||
|
|
||||||
static void FreeFollowers(index_t* const, node_t*);
|
static void FreeFollowers(index__t* const, node_t*);
|
||||||
|
|
||||||
static void FreeNode(index_t* const, node_t*);
|
static void FreeNode(index__t* const, node_t*);
|
||||||
|
|
||||||
static size_t MemorySubNodeList(uint32_t);
|
static size_t MemorySubNodeList(uint32_t);
|
||||||
|
|
||||||
|
@ -230,7 +230,7 @@ static inline size_t Padding(uint32_t numEntries) {
|
||||||
/// @brief re-allocate memory for the index and update memory usage statistics
|
/// @brief re-allocate memory for the index and update memory usage statistics
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static inline void* ReallocateMemory(index_t* const idx, void* old,
|
static inline void* ReallocateMemory(index__t* const idx, void* old,
|
||||||
size_t const newSize,
|
size_t const newSize,
|
||||||
size_t const oldSize) {
|
size_t const oldSize) {
|
||||||
void* data;
|
void* data;
|
||||||
|
@ -253,7 +253,7 @@ static inline void* ReallocateMemory(index_t* const idx, void* old,
|
||||||
/// @brief allocate memory for the index and update memory usage statistics
|
/// @brief allocate memory for the index and update memory usage statistics
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static inline void* AllocateMemory(index_t* const idx, size_t const size) {
|
static inline void* AllocateMemory(index__t* const idx, size_t const size) {
|
||||||
void* data;
|
void* data;
|
||||||
|
|
||||||
#if TRI_FULLTEXT_DEBUG
|
#if TRI_FULLTEXT_DEBUG
|
||||||
|
@ -271,7 +271,7 @@ static inline void* AllocateMemory(index_t* const idx, size_t const size) {
|
||||||
/// @brief free memory and update memory usage statistics
|
/// @brief free memory and update memory usage statistics
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static inline void FreeMemory(index_t* const idx, void* data,
|
static inline void FreeMemory(index__t* const idx, void* data,
|
||||||
size_t const size) {
|
size_t const size) {
|
||||||
#if TRI_FULLTEXT_DEBUG
|
#if TRI_FULLTEXT_DEBUG
|
||||||
TRI_ASSERT(size > 0);
|
TRI_ASSERT(size > 0);
|
||||||
|
@ -287,7 +287,7 @@ static inline void FreeMemory(index_t* const idx, void* data,
|
||||||
/// note: if the value is set to 0, this might free the sub-nodes list
|
/// note: if the value is set to 0, this might free the sub-nodes list
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static inline void SetNodeNumFollowers(index_t* const idx, node_t* const node,
|
static inline void SetNodeNumFollowers(index__t* const idx, node_t* const node,
|
||||||
uint32_t value) {
|
uint32_t value) {
|
||||||
#if TRI_FULLTEXT_DEBUG
|
#if TRI_FULLTEXT_DEBUG
|
||||||
TRI_ASSERT(node != nullptr);
|
TRI_ASSERT(node != nullptr);
|
||||||
|
@ -446,7 +446,7 @@ static size_t MemorySubNodeList(uint32_t numEntries) {
|
||||||
/// size if it is too small to hold another node
|
/// size if it is too small to hold another node
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static bool ExtendSubNodeList(index_t* const idx, node_t* const node,
|
static bool ExtendSubNodeList(index__t* const idx, node_t* const node,
|
||||||
uint32_t numFollowers, uint32_t numAllocated) {
|
uint32_t numFollowers, uint32_t numAllocated) {
|
||||||
size_t nextSize;
|
size_t nextSize;
|
||||||
uint32_t nextAllocated;
|
uint32_t nextAllocated;
|
||||||
|
@ -512,7 +512,7 @@ static bool ExtendSubNodeList(index_t* const idx, node_t* const node,
|
||||||
/// @brief create a new, empty node
|
/// @brief create a new, empty node
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static node_t* CreateNode(index_t* const idx) {
|
static node_t* CreateNode(index__t* const idx) {
|
||||||
node_t* node = static_cast<node_t*>(AllocateMemory(idx, sizeof(node_t)));
|
node_t* node = static_cast<node_t*>(AllocateMemory(idx, sizeof(node_t)));
|
||||||
|
|
||||||
if (node == nullptr) {
|
if (node == nullptr) {
|
||||||
|
@ -534,7 +534,7 @@ static node_t* CreateNode(index_t* const idx) {
|
||||||
/// @brief free a node's follower nodes
|
/// @brief free a node's follower nodes
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static void FreeFollowers(index_t* const idx, node_t* node) {
|
static void FreeFollowers(index__t* const idx, node_t* node) {
|
||||||
uint32_t numFollowers;
|
uint32_t numFollowers;
|
||||||
uint32_t numAllocated;
|
uint32_t numAllocated;
|
||||||
|
|
||||||
|
@ -571,7 +571,7 @@ static void FreeFollowers(index_t* const idx, node_t* node) {
|
||||||
/// @brief free a node in the index
|
/// @brief free a node in the index
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static void FreeNode(index_t* const idx, node_t* node) {
|
static void FreeNode(index__t* const idx, node_t* node) {
|
||||||
if (node == nullptr) {
|
if (node == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -600,7 +600,7 @@ static void FreeNode(index_t* const idx, node_t* node) {
|
||||||
/// the map contains a rewrite-map of document handles
|
/// the map contains a rewrite-map of document handles
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static bool CleanupNodes(index_t* idx, node_t* node, void* map) {
|
static bool CleanupNodes(index__t* idx, node_t* node, void* map) {
|
||||||
bool isActive;
|
bool isActive;
|
||||||
|
|
||||||
// assume we can delete the node we are processing
|
// assume we can delete the node we are processing
|
||||||
|
@ -837,7 +837,7 @@ static inline node_t* FindDirectSubNode(const node_t* const node,
|
||||||
/// @brief find a node by its key, starting from the index root
|
/// @brief find a node by its key, starting from the index root
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static node_t* FindNode(const index_t* idx, char const* const key,
|
static node_t* FindNode(const index__t* idx, char const* const key,
|
||||||
size_t const keyLength) {
|
size_t const keyLength) {
|
||||||
node_t* node;
|
node_t* node;
|
||||||
node_char_t* p;
|
node_char_t* p;
|
||||||
|
@ -932,7 +932,7 @@ static inline TRI_fulltext_list_t* GetSubNodeHandles(const node_t* const node) {
|
||||||
/// the _followers property
|
/// the _followers property
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static node_t* InsertSubNode(index_t* const idx, node_t* const node,
|
static node_t* InsertSubNode(index__t* const idx, node_t* const node,
|
||||||
uint32_t position, const node_char_t key) {
|
uint32_t position, const node_char_t key) {
|
||||||
node_t** followerNodes;
|
node_t** followerNodes;
|
||||||
node_char_t* followerKeys;
|
node_char_t* followerKeys;
|
||||||
|
@ -983,7 +983,7 @@ static node_t* InsertSubNode(index_t* const idx, node_t* const node,
|
||||||
/// if it is not there, it will be created by this function
|
/// if it is not there, it will be created by this function
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static node_t* EnsureSubNode(index_t* const idx, node_t* node,
|
static node_t* EnsureSubNode(index__t* const idx, node_t* node,
|
||||||
const node_char_t c) {
|
const node_char_t c) {
|
||||||
uint32_t numFollowers;
|
uint32_t numFollowers;
|
||||||
uint32_t numAllocated;
|
uint32_t numAllocated;
|
||||||
|
@ -1055,7 +1055,7 @@ static node_t* EnsureSubNode(index_t* const idx, node_t* node,
|
||||||
/// insert a handle for a node
|
/// insert a handle for a node
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static bool InsertHandle(index_t* const idx, node_t* const node,
|
static bool InsertHandle(index__t* const idx, node_t* const node,
|
||||||
const TRI_fulltext_handle_t handle) {
|
const TRI_fulltext_handle_t handle) {
|
||||||
TRI_fulltext_list_t* list;
|
TRI_fulltext_list_t* list;
|
||||||
TRI_fulltext_list_t* oldList;
|
TRI_fulltext_list_t* oldList;
|
||||||
|
@ -1108,7 +1108,7 @@ static bool InsertHandle(index_t* const idx, node_t* const node,
|
||||||
/// this will also exclude all deleted documents
|
/// this will also exclude all deleted documents
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static TRI_fulltext_result_t* MakeListResult(index_t* const idx,
|
static TRI_fulltext_result_t* MakeListResult(index__t* const idx,
|
||||||
TRI_fulltext_list_t* list,
|
TRI_fulltext_list_t* list,
|
||||||
size_t maxResults) {
|
size_t maxResults) {
|
||||||
TRI_fulltext_result_t* result;
|
TRI_fulltext_result_t* result;
|
||||||
|
@ -1164,7 +1164,7 @@ static TRI_fulltext_result_t* MakeListResult(index_t* const idx,
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
TRI_fulltext_result_t* FindDocuments (index_t* const idx,
|
TRI_fulltext_result_t* FindDocuments (index__t* const idx,
|
||||||
char const* const key,
|
char const* const key,
|
||||||
size_t const keyLength,
|
size_t const keyLength,
|
||||||
bool const recursive) {
|
bool const recursive) {
|
||||||
|
@ -1214,16 +1214,16 @@ static inline size_t CommonPrefixLength(char const* const lhs,
|
||||||
TRI_fts_index_t* TRI_CreateFtsIndex(uint32_t handleChunkSize,
|
TRI_fts_index_t* TRI_CreateFtsIndex(uint32_t handleChunkSize,
|
||||||
uint32_t nodeChunkSize,
|
uint32_t nodeChunkSize,
|
||||||
uint32_t initialNodeHandles) {
|
uint32_t initialNodeHandles) {
|
||||||
index_t* idx = static_cast<index_t*>(
|
index__t* idx = static_cast<index__t*>(
|
||||||
TRI_Allocate(TRI_UNKNOWN_MEM_ZONE, sizeof(index_t), false));
|
TRI_Allocate(TRI_UNKNOWN_MEM_ZONE, sizeof(index__t), false));
|
||||||
|
|
||||||
if (idx == nullptr) {
|
if (idx == nullptr) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
idx->_memoryAllocated = sizeof(index_t);
|
idx->_memoryAllocated = sizeof(index__t);
|
||||||
#if TRI_FULLTEXT_DEBUG
|
#if TRI_FULLTEXT_DEBUG
|
||||||
idx->_memoryBase = sizeof(index_t);
|
idx->_memoryBase = sizeof(index__t);
|
||||||
idx->_memoryNodes = 0;
|
idx->_memoryNodes = 0;
|
||||||
idx->_memoryFollowers = 0;
|
idx->_memoryFollowers = 0;
|
||||||
idx->_nodesAllocated = 0;
|
idx->_nodesAllocated = 0;
|
||||||
|
@ -1265,7 +1265,7 @@ TRI_fts_index_t* TRI_CreateFtsIndex(uint32_t handleChunkSize,
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void TRI_FreeFtsIndex(TRI_fts_index_t* ftx) {
|
void TRI_FreeFtsIndex(TRI_fts_index_t* ftx) {
|
||||||
index_t* idx = (index_t*)ftx;
|
index__t* idx = (index__t*)ftx;
|
||||||
|
|
||||||
// free root node (this will recursively free all other nodes)
|
// free root node (this will recursively free all other nodes)
|
||||||
FreeNode(idx, idx->_root);
|
FreeNode(idx, idx->_root);
|
||||||
|
@ -1277,10 +1277,10 @@ void TRI_FreeFtsIndex(TRI_fts_index_t* ftx) {
|
||||||
|
|
||||||
#if TRI_FULLTEXT_DEBUG
|
#if TRI_FULLTEXT_DEBUG
|
||||||
idx->_memoryBase -= sizeof(TRI_fulltext_handles_t);
|
idx->_memoryBase -= sizeof(TRI_fulltext_handles_t);
|
||||||
TRI_ASSERT(idx->_memoryBase == sizeof(index_t));
|
TRI_ASSERT(idx->_memoryBase == sizeof(index__t));
|
||||||
TRI_ASSERT(idx->_memoryFollowers == 0);
|
TRI_ASSERT(idx->_memoryFollowers == 0);
|
||||||
TRI_ASSERT(idx->_memoryNodes == 0);
|
TRI_ASSERT(idx->_memoryNodes == 0);
|
||||||
TRI_ASSERT(idx->_memoryAllocated == sizeof(index_t));
|
TRI_ASSERT(idx->_memoryAllocated == sizeof(index__t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TRI_DestroyReadWriteLock(&idx->_lock);
|
TRI_DestroyReadWriteLock(&idx->_lock);
|
||||||
|
@ -1295,7 +1295,7 @@ void TRI_FreeFtsIndex(TRI_fts_index_t* ftx) {
|
||||||
|
|
||||||
void TRI_DeleteDocumentFulltextIndex(TRI_fts_index_t* const ftx,
|
void TRI_DeleteDocumentFulltextIndex(TRI_fts_index_t* const ftx,
|
||||||
const TRI_fulltext_doc_t document) {
|
const TRI_fulltext_doc_t document) {
|
||||||
index_t* idx = (index_t*)ftx;
|
index__t* idx = (index__t*)ftx;
|
||||||
|
|
||||||
TRI_WriteLockReadWriteLock(&idx->_lock);
|
TRI_WriteLockReadWriteLock(&idx->_lock);
|
||||||
TRI_DeleteDocumentHandleFulltextIndex(idx->_handles, document);
|
TRI_DeleteDocumentHandleFulltextIndex(idx->_handles, document);
|
||||||
|
@ -1317,7 +1317,7 @@ void TRI_DeleteDocumentFulltextIndex(TRI_fts_index_t* const ftx,
|
||||||
bool TRI_InsertWordsFulltextIndex(TRI_fts_index_t* const ftx,
|
bool TRI_InsertWordsFulltextIndex(TRI_fts_index_t* const ftx,
|
||||||
const TRI_fulltext_doc_t document,
|
const TRI_fulltext_doc_t document,
|
||||||
TRI_fulltext_wordlist_t* wordlist) {
|
TRI_fulltext_wordlist_t* wordlist) {
|
||||||
index_t* idx;
|
index__t* idx;
|
||||||
TRI_fulltext_handle_t handle;
|
TRI_fulltext_handle_t handle;
|
||||||
node_t* paths[MAX_WORD_BYTES + 4];
|
node_t* paths[MAX_WORD_BYTES + 4];
|
||||||
size_t lastLength;
|
size_t lastLength;
|
||||||
|
@ -1337,7 +1337,7 @@ bool TRI_InsertWordsFulltextIndex(TRI_fts_index_t* const ftx,
|
||||||
// of words)
|
// of words)
|
||||||
TRI_SortWordlistFulltextIndex(wordlist);
|
TRI_SortWordlistFulltextIndex(wordlist);
|
||||||
|
|
||||||
idx = (index_t*)ftx;
|
idx = (index__t*)ftx;
|
||||||
|
|
||||||
TRI_WriteLockReadWriteLock(&idx->_lock);
|
TRI_WriteLockReadWriteLock(&idx->_lock);
|
||||||
|
|
||||||
|
@ -1445,7 +1445,7 @@ bool TRI_InsertWordsFulltextIndex(TRI_fts_index_t* const ftx,
|
||||||
TRI_fulltext_result_t* TRI_FindExactFulltextIndex (TRI_fts_index_t* const ftx,
|
TRI_fulltext_result_t* TRI_FindExactFulltextIndex (TRI_fts_index_t* const ftx,
|
||||||
char const* const key,
|
char const* const key,
|
||||||
size_t const keyLength) {
|
size_t const keyLength) {
|
||||||
return FindDocuments((index_t*) ftx, key, keyLength, false);
|
return FindDocuments((index__t*) ftx, key, keyLength, false);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1457,7 +1457,7 @@ TRI_fulltext_result_t* TRI_FindExactFulltextIndex (TRI_fts_index_t* const ftx,
|
||||||
TRI_fulltext_result_t* TRI_FindPrefixFulltextIndex (TRI_fts_index_t* const ftx,
|
TRI_fulltext_result_t* TRI_FindPrefixFulltextIndex (TRI_fts_index_t* const ftx,
|
||||||
char const* key,
|
char const* key,
|
||||||
size_t const keyLength) {
|
size_t const keyLength) {
|
||||||
return FindDocuments((index_t*) ftx, key, keyLength, true);
|
return FindDocuments((index__t*) ftx, key, keyLength, true);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1468,7 +1468,7 @@ TRI_fulltext_result_t* TRI_FindPrefixFulltextIndex (TRI_fts_index_t* const ftx,
|
||||||
|
|
||||||
TRI_fulltext_result_t* TRI_QueryFulltextIndex(TRI_fts_index_t* const ftx,
|
TRI_fulltext_result_t* TRI_QueryFulltextIndex(TRI_fts_index_t* const ftx,
|
||||||
TRI_fulltext_query_t* query) {
|
TRI_fulltext_query_t* query) {
|
||||||
index_t* idx;
|
index__t* idx;
|
||||||
TRI_fulltext_list_t* result;
|
TRI_fulltext_list_t* result;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
|
@ -1484,7 +1484,7 @@ TRI_fulltext_result_t* TRI_QueryFulltextIndex(TRI_fts_index_t* const ftx,
|
||||||
|
|
||||||
auto maxResults = query->_maxResults;
|
auto maxResults = query->_maxResults;
|
||||||
|
|
||||||
idx = (index_t*)ftx;
|
idx = (index__t*)ftx;
|
||||||
|
|
||||||
TRI_ReadLockReadWriteLock(&idx->_lock);
|
TRI_ReadLockReadWriteLock(&idx->_lock);
|
||||||
|
|
||||||
|
@ -1570,7 +1570,7 @@ TRI_fulltext_result_t* TRI_QueryFulltextIndex(TRI_fts_index_t* const ftx,
|
||||||
|
|
||||||
#if TRI_FULLTEXT_DEBUG
|
#if TRI_FULLTEXT_DEBUG
|
||||||
void TRI_DumpTreeFtsIndex(const TRI_fts_index_t* const ftx) {
|
void TRI_DumpTreeFtsIndex(const TRI_fts_index_t* const ftx) {
|
||||||
index_t* idx = (index_t*)ftx;
|
index__t* idx = (index__t*)ftx;
|
||||||
|
|
||||||
TRI_DumpHandleFulltextIndex(idx->_handles);
|
TRI_DumpHandleFulltextIndex(idx->_handles);
|
||||||
DumpNode(idx->_root, 0);
|
DumpNode(idx->_root, 0);
|
||||||
|
@ -1583,7 +1583,7 @@ void TRI_DumpTreeFtsIndex(const TRI_fts_index_t* const ftx) {
|
||||||
|
|
||||||
#if TRI_FULLTEXT_DEBUG
|
#if TRI_FULLTEXT_DEBUG
|
||||||
void TRI_DumpStatsFtsIndex(const TRI_fts_index_t* const ftx) {
|
void TRI_DumpStatsFtsIndex(const TRI_fts_index_t* const ftx) {
|
||||||
index_t* idx = (index_t*)ftx;
|
index__t* idx = (index__t*)ftx;
|
||||||
TRI_fulltext_stats_t stats;
|
TRI_fulltext_stats_t stats;
|
||||||
|
|
||||||
stats = TRI_StatsFulltextIndex(idx);
|
stats = TRI_StatsFulltextIndex(idx);
|
||||||
|
@ -1612,10 +1612,10 @@ void TRI_DumpStatsFtsIndex(const TRI_fts_index_t* const ftx) {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
TRI_fulltext_stats_t TRI_StatsFulltextIndex(const TRI_fts_index_t* const ftx) {
|
TRI_fulltext_stats_t TRI_StatsFulltextIndex(const TRI_fts_index_t* const ftx) {
|
||||||
index_t* idx;
|
index__t* idx;
|
||||||
TRI_fulltext_stats_t stats;
|
TRI_fulltext_stats_t stats;
|
||||||
|
|
||||||
idx = (index_t*)ftx;
|
idx = (index__t*)ftx;
|
||||||
|
|
||||||
TRI_ReadLockReadWriteLock(&idx->_lock);
|
TRI_ReadLockReadWriteLock(&idx->_lock);
|
||||||
|
|
||||||
|
@ -1655,7 +1655,7 @@ TRI_fulltext_stats_t TRI_StatsFulltextIndex(const TRI_fts_index_t* const ftx) {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
size_t TRI_MemoryFulltextIndex(const TRI_fts_index_t* const ftx) {
|
size_t TRI_MemoryFulltextIndex(const TRI_fts_index_t* const ftx) {
|
||||||
index_t* idx = (index_t*)ftx;
|
index__t* idx = (index__t*)ftx;
|
||||||
|
|
||||||
if (idx->_handles != nullptr) {
|
if (idx->_handles != nullptr) {
|
||||||
return idx->_memoryAllocated + TRI_MemoryHandleFulltextIndex(idx->_handles);
|
return idx->_memoryAllocated + TRI_MemoryHandleFulltextIndex(idx->_handles);
|
||||||
|
@ -1670,10 +1670,10 @@ size_t TRI_MemoryFulltextIndex(const TRI_fts_index_t* const ftx) {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
bool TRI_CompactFulltextIndex(TRI_fts_index_t* const ftx) {
|
bool TRI_CompactFulltextIndex(TRI_fts_index_t* const ftx) {
|
||||||
index_t* idx;
|
index__t* idx;
|
||||||
TRI_fulltext_handles_t* clone;
|
TRI_fulltext_handles_t* clone;
|
||||||
|
|
||||||
idx = (index_t*)ftx;
|
idx = (index__t*)ftx;
|
||||||
|
|
||||||
// but don't block if the index is busy
|
// but don't block if the index is busy
|
||||||
// try to acquire the write lock to clean up
|
// try to acquire the write lock to clean up
|
||||||
|
|
14
configure.ac
14
configure.ac
|
@ -95,6 +95,7 @@ dnl ----------------------------------------------------------------------------
|
||||||
|
|
||||||
tr_DARWIN="no"
|
tr_DARWIN="no"
|
||||||
tr_FREEBSD="no"
|
tr_FREEBSD="no"
|
||||||
|
tr_SOLARIS="no"
|
||||||
tr_ARM="no"
|
tr_ARM="no"
|
||||||
|
|
||||||
case $target in
|
case $target in
|
||||||
|
@ -106,6 +107,15 @@ case $target in
|
||||||
tr_FREEBSD="yes"
|
tr_FREEBSD="yes"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
*-*-solaris*)
|
||||||
|
tr_SOLARIS="yes"
|
||||||
|
CC="gcc -std=gnu99"
|
||||||
|
CPPFLAGS=" -I/opt/local/include -L/opt/local/lib"
|
||||||
|
CXXFLAGS="-static-libstdc++ -D_GLIBCXX_USE_C99"
|
||||||
|
LDFLAGS="-Wl,-rpath,/opt/local/lib,-lnsl,-lsocket -L/opt/local/lib"
|
||||||
|
LIBEV_FLAGS="${LIBEV_FLAGS} -D _REENTRANT=1 -D HAVE_PORT_H=1 -D EV_USE_PORT=1 -D EV_USE_INOTIFY=0 -D EV_USE_EVENTFD=0"
|
||||||
|
;;
|
||||||
|
|
||||||
armv7l-*-linux-gnueabihf)
|
armv7l-*-linux-gnueabihf)
|
||||||
CXXFLAGS="${CXXFLAGS} -O0"
|
CXXFLAGS="${CXXFLAGS} -O0"
|
||||||
tr_ARM="yes"
|
tr_ARM="yes"
|
||||||
|
@ -125,6 +135,7 @@ esac
|
||||||
|
|
||||||
AM_CONDITIONAL(ENABLE_DARWIN, test "x$tr_DARWIN" = xyes)
|
AM_CONDITIONAL(ENABLE_DARWIN, test "x$tr_DARWIN" = xyes)
|
||||||
AM_CONDITIONAL(ENABLE_FREEBSD, test "x$tr_FREEBSD" = xyes)
|
AM_CONDITIONAL(ENABLE_FREEBSD, test "x$tr_FREEBSD" = xyes)
|
||||||
|
AM_CONDITIONAL(ENABLE_SOLARIS, test "x$tr_SOLARIS" = xyes)
|
||||||
AM_CONDITIONAL(ENABLE_ARM, test "x$tr_ARM" = xyes)
|
AM_CONDITIONAL(ENABLE_ARM, test "x$tr_ARM" = xyes)
|
||||||
AM_CONDITIONAL(ENABLE_ARMV6, test "x$tr_ARM6" = xyes)
|
AM_CONDITIONAL(ENABLE_ARMV6, test "x$tr_ARM6" = xyes)
|
||||||
AM_CONDITIONAL(ENABLE_ARMV7, test "x$tr_ARM7" = xyes)
|
AM_CONDITIONAL(ENABLE_ARMV7, test "x$tr_ARM7" = xyes)
|
||||||
|
@ -568,11 +579,13 @@ LIBEV_CPPFLAGS="-I${srcdir}/3rdParty/libev -DTRI_LIBEV_VERSION='\"${LIBEV_VERSIO
|
||||||
LIBEV_CPPFLAGS="${LIBEV_CPPFLAGS}"
|
LIBEV_CPPFLAGS="${LIBEV_CPPFLAGS}"
|
||||||
LIBEV_LDFLAGS=""
|
LIBEV_LDFLAGS=""
|
||||||
LIBEV_LIBS="${srcdir}/3rdParty/libev/BUILD/.libs/libev.a"
|
LIBEV_LIBS="${srcdir}/3rdParty/libev/BUILD/.libs/libev.a"
|
||||||
|
LIBEV_FLAGS="${LIBEV_FLAGS}"
|
||||||
|
|
||||||
AC_SUBST(LIBEV_VERSION)
|
AC_SUBST(LIBEV_VERSION)
|
||||||
AC_SUBST(LIBEV_CPPFLAGS)
|
AC_SUBST(LIBEV_CPPFLAGS)
|
||||||
AC_SUBST(LIBEV_LDFLAGS)
|
AC_SUBST(LIBEV_LDFLAGS)
|
||||||
AC_SUBST(LIBEV_LIBS)
|
AC_SUBST(LIBEV_LIBS)
|
||||||
|
AC_SUBST(LIBEV_FLAGS)
|
||||||
|
|
||||||
LIB_INFO="$LIB_INFO|LIBEV: 3rdParty version"
|
LIB_INFO="$LIB_INFO|LIBEV: 3rdParty version"
|
||||||
LIB_INFO="$LIB_INFO|LIBEV VERSION: ${LIBEV_VERSION}"
|
LIB_INFO="$LIB_INFO|LIBEV VERSION: ${LIBEV_VERSION}"
|
||||||
|
@ -580,6 +593,7 @@ LIB_INFO="$LIB_INFO|LIBEV VERSION: ${LIBEV_VERSION}"
|
||||||
LIB_INFO="$LIB_INFO|LIBEV_CPPFLAGS: ${LIBEV_CPPFLAGS}"
|
LIB_INFO="$LIB_INFO|LIBEV_CPPFLAGS: ${LIBEV_CPPFLAGS}"
|
||||||
LIB_INFO="$LIB_INFO|LIBEV_LDFLAGS: ${LIBEV_LDFLAGS}"
|
LIB_INFO="$LIB_INFO|LIBEV_LDFLAGS: ${LIBEV_LDFLAGS}"
|
||||||
LIB_INFO="$LIB_INFO|LIBEV_LIBS: ${LIBEV_LIBS}"
|
LIB_INFO="$LIB_INFO|LIBEV_LIBS: ${LIBEV_LIBS}"
|
||||||
|
LIB_INFO="$LIB_INFO|LIBEV_FLAGS: ${LIBEV_FLAGS}"
|
||||||
|
|
||||||
LIB_INFO="$LIB_INFO|."
|
LIB_INFO="$LIB_INFO|."
|
||||||
|
|
||||||
|
|
|
@ -345,8 +345,6 @@ bool copyDirectoryRecursive(std::string const& source,
|
||||||
std::string const& target, std::string& error) {
|
std::string const& target, std::string& error) {
|
||||||
bool rc = true;
|
bool rc = true;
|
||||||
#ifdef TRI_HAVE_WIN32_LIST_FILES
|
#ifdef TRI_HAVE_WIN32_LIST_FILES
|
||||||
auto isSymlink = [](struct _finddata_t item) -> bool { return false; };
|
|
||||||
|
|
||||||
auto isSubDirectory = [](struct _finddata_t item) -> bool {
|
auto isSubDirectory = [](struct _finddata_t item) -> bool {
|
||||||
return ((item.attrib & _A_SUBDIR) != 0);
|
return ((item.attrib & _A_SUBDIR) != 0);
|
||||||
};
|
};
|
||||||
|
@ -364,11 +362,7 @@ bool copyDirectoryRecursive(std::string const& source,
|
||||||
|
|
||||||
do {
|
do {
|
||||||
#else
|
#else
|
||||||
auto isSymlink =
|
auto isSubDirectory = [](struct dirent* item) -> bool { return isDirectory(item->d_name); };
|
||||||
[](struct dirent* item) -> bool { return (item->d_type == DT_LNK); };
|
|
||||||
|
|
||||||
auto isSubDirectory =
|
|
||||||
[](struct dirent* item) -> bool { return (item->d_type == DT_DIR); };
|
|
||||||
|
|
||||||
struct dirent* d = (struct dirent*)TRI_Allocate(
|
struct dirent* d = (struct dirent*)TRI_Allocate(
|
||||||
TRI_UNKNOWN_MEM_ZONE, (offsetof(struct dirent, d_name) + PATH_MAX + 1),
|
TRI_UNKNOWN_MEM_ZONE, (offsetof(struct dirent, d_name) + PATH_MAX + 1),
|
||||||
|
@ -413,7 +407,7 @@ bool copyDirectoryRecursive(std::string const& source,
|
||||||
if (!TRI_CopyAttributes(src, dst, error)) {
|
if (!TRI_CopyAttributes(src, dst, error)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (isSymlink(oneItem)) {
|
} else if (isSymbolicLink(oneItem->d_name)) {
|
||||||
if (!TRI_CopySymlink(src, dst, error)) {
|
if (!TRI_CopySymlink(src, dst, error)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -487,7 +481,7 @@ std::vector<std::string> listFiles(std::string const& directory) {
|
||||||
bool isDirectory(std::string const& path) {
|
bool isDirectory(std::string const& path) {
|
||||||
TRI_stat_t stbuf;
|
TRI_stat_t stbuf;
|
||||||
int res = TRI_STAT(path.c_str(), &stbuf);
|
int res = TRI_STAT(path.c_str(), &stbuf);
|
||||||
return (res == 0) && ((stbuf.st_mode & S_IFMT) == S_IFDIR);
|
return (res == 0) && S_ISDIR(stbuf.st_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isSymbolicLink(std::string const& path) {
|
bool isSymbolicLink(std::string const& path) {
|
||||||
|
@ -506,7 +500,7 @@ bool isSymbolicLink(std::string const& path) {
|
||||||
struct stat stbuf;
|
struct stat stbuf;
|
||||||
int res = TRI_STAT(path.c_str(), &stbuf);
|
int res = TRI_STAT(path.c_str(), &stbuf);
|
||||||
|
|
||||||
return (res == 0) && ((stbuf.st_mode & S_IFMT) == S_IFLNK);
|
return (res == 0) && S_ISLNK(stbuf.st_mode);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ namespace {
|
||||||
/// @brief random version
|
/// @brief random version
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
Random::random_e version = Random::RAND_MERSENNE;
|
Random::random_e random_version = Random::RAND_MERSENNE;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief random lock
|
/// @brief random lock
|
||||||
|
@ -540,10 +540,10 @@ std::string UniformCharacter::random(size_t length) {
|
||||||
random_e selectVersion(random_e newVersion) {
|
random_e selectVersion(random_e newVersion) {
|
||||||
MUTEX_LOCKER(mutexLocker, RandomLock);
|
MUTEX_LOCKER(mutexLocker, RandomLock);
|
||||||
|
|
||||||
random_e oldVersion = version;
|
random_e oldVersion = random_version;
|
||||||
version = newVersion;
|
random_version = newVersion;
|
||||||
|
|
||||||
switch (version) {
|
switch (random_version) {
|
||||||
case RAND_MERSENNE: {
|
case RAND_MERSENNE: {
|
||||||
uniformInteger.reset(new UniformIntegerMersenne);
|
uniformInteger.reset(new UniformIntegerMersenne);
|
||||||
break;
|
break;
|
||||||
|
@ -604,11 +604,11 @@ random_e selectVersion(random_e newVersion) {
|
||||||
return oldVersion;
|
return oldVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
random_e currentVersion() { return version; }
|
random_e currentVersion() { return random_version; }
|
||||||
|
|
||||||
void shutdown() {}
|
void shutdown() {}
|
||||||
|
|
||||||
bool isBlocking() { return version == RAND_RANDOM; }
|
bool isBlocking() { return random_version == RAND_RANDOM; }
|
||||||
|
|
||||||
int32_t interval(int32_t left, int32_t right) {
|
int32_t interval(int32_t left, int32_t right) {
|
||||||
MUTEX_LOCKER(mutexLocker, RandomLock);
|
MUTEX_LOCKER(mutexLocker, RandomLock);
|
||||||
|
|
|
@ -39,6 +39,140 @@
|
||||||
#define TRI_PADDING_32 1
|
#define TRI_PADDING_32 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --Section-- solaris
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#ifdef __sun
|
||||||
|
|
||||||
|
#define TRI_PLATFORM "solaris"
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief enabled features
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#define TRI_ENABLE_SYSLOG 1
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief available include files
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#define TRI_HAVE_DIRENT_H 1
|
||||||
|
#define TRI_HAVE_FORK 1
|
||||||
|
#define TRI_HAVE_GETRLIMIT 1
|
||||||
|
#define TRI_HAVE_LIMITS_H 1
|
||||||
|
#define TRI_HAVE_SCHED_H 1
|
||||||
|
#define TRI_HAVE_SIGNAL_H 1
|
||||||
|
#define TRI_HAVE_STDBOOL_H 1
|
||||||
|
#define TRI_HAVE_TERMIOS_H 1
|
||||||
|
#define TRI_HAVE_UNISTD_H 1
|
||||||
|
#define TRI_HAVE_POLL_H 1
|
||||||
|
|
||||||
|
#define TRI_HAVE_SYS_IOCTL_H 1
|
||||||
|
#define TRI_HAVE_SYS_RESOURCE_H 1
|
||||||
|
#define TRI_HAVE_SYS_TIME_H 1
|
||||||
|
#define TRI_HAVE_SYS_TYPES_H 1
|
||||||
|
#define TRI_HAVE_SYS_WAIT_H 1
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief available functions
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#define TRI_HAVE_GETGRGID 1
|
||||||
|
#define TRI_HAVE_GETGRNAM 1
|
||||||
|
#define TRI_HAVE_GETPPID 1
|
||||||
|
#define TRI_HAVE_GETPWNAM 1
|
||||||
|
#define TRI_HAVE_GETPWUID 1
|
||||||
|
#define TRI_HAVE_GETRUSAGE 1
|
||||||
|
#define TRI_GETRUSAGE_MAXRSS_UNIT 1024
|
||||||
|
#define TRI_HAVE_GETTIMEOFDAY 1
|
||||||
|
#define TRI_HAVE_GMTIME_R 1
|
||||||
|
#define TRI_HAVE_LOCALTIME_R 1
|
||||||
|
#define TRI_HAVE_SETGID 1
|
||||||
|
#define TRI_HAVE_SETUID 1
|
||||||
|
#define TRI_HAVE_STRTOLL 1
|
||||||
|
#define TRI_HAVE_STRTOULL 1
|
||||||
|
|
||||||
|
#define TRI_srandom srand
|
||||||
|
#define TRI_random rand
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief available features
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#define TRI_HAVE_POSIX 1
|
||||||
|
|
||||||
|
#define TRI_HAVE_SC_PHYS_PAGES 1
|
||||||
|
#define TRI_HAVE_LINUX_PROC 1
|
||||||
|
#define TRI_HAVE_LINUX_SOCKETS 1
|
||||||
|
#define TRI_HAVE_POSIX_SPIN 1
|
||||||
|
#define TRI_HAVE_POSIX_THREADS 1
|
||||||
|
#define TRI_HAVE_POSIX_MMAP 1
|
||||||
|
#define TRI_HAVE_POSIX_PWD_GRP 1
|
||||||
|
|
||||||
|
#define TRI_HAVE_ANONYMOUS_MMAP 1
|
||||||
|
|
||||||
|
#define TRI_MISSING_MEMRCHR 1
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief files
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#define TRI_DIR_SEPARATOR_CHAR '/'
|
||||||
|
#define TRI_DIR_SEPARATOR_STR "/"
|
||||||
|
|
||||||
|
#define TRI_O_CLOEXEC O_CLOEXEC
|
||||||
|
|
||||||
|
#define TRI_CHDIR chdir
|
||||||
|
#define TRI_CLOSE close
|
||||||
|
#define TRI_CREATE(a, b, c) open((a), (b), (c))
|
||||||
|
#define TRI_GETCWD getcwd
|
||||||
|
#define TRI_LSEEK lseek
|
||||||
|
#define TRI_MKDIR(a, b) mkdir((a), (b))
|
||||||
|
#define TRI_OPEN(a, b) open((a), (b))
|
||||||
|
#define TRI_READ read
|
||||||
|
#define TRI_RMDIR rmdir
|
||||||
|
#define TRI_UNLINK unlink
|
||||||
|
#define TRI_WRITE write
|
||||||
|
#define TRI_STAT stat
|
||||||
|
#define TRI_FSTAT fstat
|
||||||
|
#define TRI_STAT_ATIME_SEC(statbuf) statbuf.st_atim.tv_sec
|
||||||
|
#define TRI_STAT_MTIME_SEC(statbuf) statbuf.st_mtim.tv_sec
|
||||||
|
|
||||||
|
#define TRI_write_t size_t
|
||||||
|
#define TRI_read_t size_t
|
||||||
|
#define TRI_lseek_t off_t
|
||||||
|
#define TRI_stat_t struct stat
|
||||||
|
|
||||||
|
#define TRI_LAST_ERROR_STR strerror(errno)
|
||||||
|
#define TRI_SYSTEM_ERROR() \
|
||||||
|
{}
|
||||||
|
#define TRI_ERRORBUF \
|
||||||
|
{}
|
||||||
|
#define TRI_GET_ERRORBUF strerror(errno)
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief sockets
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#define TRI_CONNECT_AI_FLAGS AI_PASSIVE | AI_NUMERICSERV | AI_ALL
|
||||||
|
|
||||||
|
#define TRI_INVALID_SOCKET -1
|
||||||
|
|
||||||
|
#define TRI_CLOSE_SOCKET TRI_closesocket
|
||||||
|
#define TRI_READ_SOCKET(a, b, c, d) TRI_readsocket((a), (b), (c), (d))
|
||||||
|
#define TRI_WRITE_SOCKET(a, b, c, d) TRI_writesocket((a), (b), (c), (d))
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief user and group types
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#define TRI_uid_t uid_t
|
||||||
|
#define TRI_gid_t gid_t
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// --Section-- apple
|
// --Section-- apple
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
|
@ -299,7 +299,7 @@ static char* FillVariables(char const* value) {
|
||||||
static struct option* InitOptionStructure(struct option* option,
|
static struct option* InitOptionStructure(struct option* option,
|
||||||
char const* name, int hasArg,
|
char const* name, int hasArg,
|
||||||
int* flag, int val) {
|
int* flag, int val) {
|
||||||
option->name = name;
|
option->name = const_cast<char*>(name);
|
||||||
option->has_arg = hasArg;
|
option->has_arg = hasArg;
|
||||||
option->flag = flag;
|
option->flag = flag;
|
||||||
option->val = 256 + val;
|
option->val = 256 + val;
|
||||||
|
|
|
@ -56,10 +56,17 @@ unsigned long opensslThreadId() { return (unsigned long)TRI_CurrentThreadId(); }
|
||||||
// The compiler chooses the right one from the following two,
|
// The compiler chooses the right one from the following two,
|
||||||
// according to the type of the return value of pthread_self():
|
// according to the type of the return value of pthread_self():
|
||||||
|
|
||||||
|
#ifndef __sun
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void setter(CRYPTO_THREADID* id, T p) {
|
void setter(CRYPTO_THREADID* id, T p) {
|
||||||
CRYPTO_THREADID_set_pointer(id, p);
|
CRYPTO_THREADID_set_pointer(id, p);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
template <typename T>
|
||||||
|
void setter(CRYPTO_THREADID* id, T p) {
|
||||||
|
CRYPTO_THREADID_set_pointer(id, (void *) (intptr_t) p);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
template <>
|
template <>
|
||||||
|
|
|
@ -327,6 +327,9 @@ bool ClientConnection::writeClientConnection(void const* buffer, size_t length,
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
// MSG_NOSIGNAL not supported on windows platform
|
// MSG_NOSIGNAL not supported on windows platform
|
||||||
int status = TRI_send(_socket, buffer, length, 0);
|
int status = TRI_send(_socket, buffer, length, 0);
|
||||||
|
#elif defined(__sun)
|
||||||
|
// MSG_NOSIGNAL not supported on solaris platform
|
||||||
|
int status = TRI_send(_socket, buffer, length, 0);
|
||||||
#else
|
#else
|
||||||
int status = TRI_send(_socket, buffer, length, MSG_NOSIGNAL);
|
int status = TRI_send(_socket, buffer, length, MSG_NOSIGNAL);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# https://raw.githubusercontent.com/OpenIndiana/oi-userland/99a87285ed04d3e99bc8e321f272301e444b1561/components/firefox/files/gld-wrapper
|
||||||
|
|
||||||
|
was_Y=0
|
||||||
|
skip_next=0
|
||||||
|
args=""
|
||||||
|
|
||||||
|
for arg in "$@"; do
|
||||||
|
if [ $was_Y -eq 1 ]; then
|
||||||
|
arg=$(echo $arg | sed 's/P,//')
|
||||||
|
was_Y=0;
|
||||||
|
fi
|
||||||
|
if [ $skip_next -eq 0 ]; then
|
||||||
|
if [ "$arg" = "-G" ] ; then
|
||||||
|
args="$args -shared";
|
||||||
|
elif [ "$arg" = "-dy" ] ; then
|
||||||
|
; # skipping
|
||||||
|
elif [ "$arg" = "-M" ]; then
|
||||||
|
skip_next=1; # skipping this one and the next one
|
||||||
|
elif [ "$arg" = "-Y" ]; then
|
||||||
|
args="$args -rpath"
|
||||||
|
was_Y=1;
|
||||||
|
else
|
||||||
|
args="$args $arg"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
skip_next=0;
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
args="$args"
|
||||||
|
|
||||||
|
exec /opt/local/x86_64-sun-solaris2.11/bin/ld $args
|
Loading…
Reference in New Issue