mirror of https://gitee.com/bigwinds/arangodb
split headers different, simple cast fixes (#8928)
This commit is contained in:
parent
d50eeb0410
commit
1ae5f8daec
|
@ -61,6 +61,20 @@
|
|||
#define STDIN_FILENO 0
|
||||
#define STDOUT_FILENO 1
|
||||
#define STDERR_FILENO 2
|
||||
|
||||
#ifdef S_IRGRP
|
||||
#undef S_IRGRP
|
||||
#endif
|
||||
#ifdef S_IRUSR
|
||||
#undef S_IRUSR
|
||||
#endif
|
||||
#ifdef S_IWGRP
|
||||
#undef S_IWGRP
|
||||
#endif
|
||||
#ifdef S_IWUSR
|
||||
#undef S_IWUSR
|
||||
#endif
|
||||
|
||||
#define S_IRUSR 00400
|
||||
#define S_IWUSR 00200
|
||||
#define S_IXUSR 00100
|
||||
|
|
|
@ -421,7 +421,7 @@ ManagedDirectory::File::File(ManagedDirectory const& directory,
|
|||
|
||||
// gzip is going to perform a redundant close,
|
||||
// simpler code to give it redundant handle
|
||||
_gzfd = dup(_fd);
|
||||
_gzfd = TRI_DUP(_fd);
|
||||
|
||||
if (O_WRONLY & flags) {
|
||||
gzFlags = "wb";
|
||||
|
|
|
@ -146,20 +146,6 @@
|
|||
#endif
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
// .............................................................................
|
||||
// The problem we have for visual studio is that if we include WinSock2.h here
|
||||
// it may conflict later in some other source file. The conflict arises when
|
||||
// windows.h is included BEFORE WinSock2.h -- this is a visual studio issue. For
|
||||
// now be VERY careful to ensure that if you need windows.h, then you include
|
||||
// this file AFTER common.h.
|
||||
// .............................................................................
|
||||
|
||||
#ifdef TRI_HAVE_WINSOCK2_H
|
||||
#include <WinSock2.h>
|
||||
typedef long suseconds_t;
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <atomic>
|
||||
#include <cmath>
|
||||
|
|
|
@ -45,7 +45,7 @@ using namespace icu;
|
|||
|
||||
#ifdef _WIN32
|
||||
std::wstring arangodb::basics::toWString(std::string const& validUTF8String) {
|
||||
icu::UnicodeString utf16(validUTF8String.c_str(), validUTF8String.size());
|
||||
icu::UnicodeString utf16(validUTF8String.c_str(), static_cast<int32_t>(validUTF8String.size()));
|
||||
// // probably required for newer c++ versions
|
||||
// using bufferType = std::remove_pointer_t<decltype(utf16.getTerminatedBuffer())>;
|
||||
// static_assert(sizeof(std::wchar_t) == sizeof(bufferType), "sizes do not match");
|
||||
|
@ -55,7 +55,7 @@ std::wstring arangodb::basics::toWString(std::string const& validUTF8String) {
|
|||
|
||||
std::string arangodb::basics::fromWString(wchar_t const* validUTF16String, std::size_t size) {
|
||||
std::string out;
|
||||
icu::UnicodeString ICUString(validUTF16String, size);
|
||||
icu::UnicodeString ICUString(validUTF16String, static_cast<int32_t>(size));
|
||||
ICUString.toUTF8String<std::string>(out);
|
||||
return out;
|
||||
}
|
||||
|
|
|
@ -28,8 +28,6 @@
|
|||
|
||||
#ifdef TRI_HAVE_WIN32_MMAP
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief undefine this so anonymous memory mapping is disabled
|
||||
///
|
||||
|
|
|
@ -170,6 +170,7 @@
|
|||
#define TRI_MKDIR(a, b) ::mkdir((a), (b))
|
||||
#define TRI_OPEN(a, b) ::open((a), (b))
|
||||
#define TRI_FOPEN(a, b) ::fopen((a), (b))
|
||||
#define TRI_DUP ::dup
|
||||
#define TRI_READ ::read
|
||||
#define TRI_RMDIR ::rmdir
|
||||
#define TRI_STAT ::stat
|
||||
|
@ -326,6 +327,7 @@
|
|||
#define TRI_OPEN(a, b) ::open((a), (b))
|
||||
#define TRI_FOPEN(a, b) ::fopen((a), (b))
|
||||
#define TRI_READ ::read
|
||||
#define TRI_DUP ::dup
|
||||
#define TRI_RMDIR ::rmdir
|
||||
#define TRI_STAT ::stat
|
||||
#define TRI_STAT_ATIME_SEC(statbuf) statbuf.st_atimespec.tv_sec
|
||||
|
@ -472,6 +474,7 @@
|
|||
#define TRI_OPEN(a, b) ::open((a), (b))
|
||||
#define TRI_FOPEN(a, b) ::fopen((a), (b))
|
||||
#define TRI_READ ::read
|
||||
#define TRI_DUP ::dup
|
||||
#define TRI_RMDIR ::rmdir
|
||||
#define TRI_STAT ::stat
|
||||
#define TRI_STAT_ATIME_SEC(statbuf) statbuf.st_atimespec.tv_sec
|
||||
|
@ -631,6 +634,7 @@
|
|||
#define TRI_OPEN(a, b) ::open((a), (b))
|
||||
#define TRI_FOPEN(a, b) ::fopen((a), (b))
|
||||
#define TRI_READ ::read
|
||||
#define TRI_DUP ::dup
|
||||
#define TRI_RMDIR ::rmdir
|
||||
#define TRI_STAT ::stat
|
||||
#define TRI_STAT_ATIME_SEC(statbuf) statbuf.st_atim.tv_sec
|
||||
|
@ -833,6 +837,7 @@ typedef unsigned char bool;
|
|||
#define TRI_MKDIR(a, b) TRI_MKDIR_WIN32(a)
|
||||
#define TRI_OPEN(a, b) TRI_OPEN_WIN32((a), (b))
|
||||
#define TRI_READ ::_read
|
||||
#define TRI_DUP ::_dup
|
||||
#define TRI_WRITE ::_write
|
||||
#define TRI_FDOPEN(a, b) ::_fdopen((a), (b))
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "Basics/socket-utils.h"
|
||||
#include <Psapi.h>
|
||||
#include <TlHelp32.h>
|
||||
#include <unicode/unistr.h>
|
||||
|
|
|
@ -27,10 +27,13 @@
|
|||
#include "Basics/Common.h"
|
||||
|
||||
#ifdef TRI_HAVE_WINSOCK2_H
|
||||
#include <WS2tcpip.h>
|
||||
#include <WinSock2.h>
|
||||
#include <WS2tcpip.h>
|
||||
|
||||
typedef long suseconds_t;
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief socket types
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
/// @author Dr. Oreste Costa-Panaia
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <WinSock2.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <io.h>
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
#ifndef ARANGODB_BASICS_WIN__UTILS_H
|
||||
#define ARANGODB_BASICS_WIN__UTILS_H 1
|
||||
|
||||
#include <WinSock2.h>
|
||||
#include <string>
|
||||
#include <IntSafe.h>
|
||||
|
||||
#include "Basics/Result.h"
|
||||
|
||||
|
@ -127,7 +127,11 @@ bool terminalKnowsANSIColors();
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// returns returns the filename in conjunction with a handle
|
||||
// only visible, if winndef.h was previously included for HANDLE.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef _WINDEF_
|
||||
std::string getFileNameFromHandle(HANDLE fileHandle);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -24,7 +24,9 @@
|
|||
#include "v8-utils.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windef.h>
|
||||
#include <conio.h>
|
||||
#include <WinSock2.h>
|
||||
#include "Basics/win-utils.h"
|
||||
#endif
|
||||
|
||||
|
@ -4130,7 +4132,7 @@ static void convertProcessInfoToV8(v8::FunctionCallbackInfo<v8::Value> const& ar
|
|||
|
||||
v8::Handle<v8::Array> arguments =
|
||||
v8::Array::New(isolate, static_cast<int>(external_process._numberArguments));
|
||||
for (size_t i = 0; i < external_process._numberArguments; i++) {
|
||||
for (uint32_t i = 0; i < external_process._numberArguments; i++) {
|
||||
arguments->Set(i, TRI_V8_ASCII_STRING(isolate, external_process._arguments[i]));
|
||||
}
|
||||
result->Set(TRI_V8_ASCII_STRING(isolate, "arguments"), arguments);
|
||||
|
@ -5308,7 +5310,7 @@ static void JS_ErrorNumberToHttpCode(v8::FunctionCallbackInfo<v8::Value> const&
|
|||
}
|
||||
|
||||
auto num = TRI_ObjectToInt64(isolate, args[0]);
|
||||
auto code = arangodb::GeneralResponse::responseCode(num);
|
||||
auto code = arangodb::GeneralResponse::responseCode(static_cast<int>(num));
|
||||
|
||||
using Type = typename std::underlying_type<arangodb::rest::ResponseCode>::type;
|
||||
TRI_V8_RETURN_INTEGER(static_cast<Type>(code));
|
||||
|
|
Loading…
Reference in New Issue