mirror of
https://github.com/haiwen/seafile.git
synced 2025-01-08 11:57:44 +08:00
Fix compile in Mingw64.
This commit is contained in:
parent
dc1b655553
commit
3f9cf6a673
@ -9,7 +9,8 @@ AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
AM_INIT_AUTOMAKE([1.9 foreign])
|
||||
|
||||
AC_MINGW32
|
||||
#AC_MINGW32
|
||||
AC_CANONICAL_BUILD
|
||||
|
||||
dnl enable the build of share library by default
|
||||
AC_ENABLE_SHARED
|
||||
@ -35,9 +36,9 @@ AC_SYS_LARGEFILE
|
||||
|
||||
# check platform
|
||||
AC_MSG_CHECKING(for WIN32)
|
||||
if test "$MINGW32" = yes; then
|
||||
if test "$build_os" = "mingw32" -o "$build_os" = "mingw64"; then
|
||||
bwin32=true
|
||||
AC_MSG_RESULT(compile in mingw32)
|
||||
AC_MSG_RESULT(compile in mingw)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
@ -3249,7 +3249,7 @@ http_upload_thread (void *vdata)
|
||||
if (!local) {
|
||||
seaf_warning ("Failed to get branch local of repo %.8s.\n", task->repo_id);
|
||||
task->error = HTTP_TASK_ERR_BAD_LOCAL_DATA;
|
||||
goto out;
|
||||
return NULL;
|
||||
}
|
||||
memcpy (task->head, local->commit_id, 40);
|
||||
seaf_branch_unref (local);
|
||||
|
@ -1070,8 +1070,9 @@ static int
|
||||
load_blocklist_v2 (TransferTask *task)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
SeafBranch *local = NULL, *master = NULL;
|
||||
SeafCommit *local_head = NULL, *master_head = NULL;
|
||||
|
||||
local = seaf_branch_manager_get_branch (seaf->branch_mgr, task->repo_id, "local");
|
||||
if (!local) {
|
||||
seaf_warning ("Branch local not found for repo %.8s.\n", task->repo_id);
|
||||
@ -1085,7 +1086,6 @@ load_blocklist_v2 (TransferTask *task)
|
||||
goto out;
|
||||
}
|
||||
|
||||
SeafCommit *local_head = NULL, *master_head = NULL;
|
||||
local_head = seaf_commit_manager_get_commit (seaf->commit_mgr,
|
||||
task->repo_id, task->repo_version,
|
||||
local->commit_id);
|
||||
|
@ -675,10 +675,10 @@ static HANDLE add_watch (SeafWTMonitorPriv *priv,
|
||||
|
||||
pthread_mutex_lock (&priv->hash_lock);
|
||||
g_hash_table_insert (priv->handle_hash,
|
||||
g_strdup(repo_id), (gpointer)(long)dir_handle);
|
||||
g_strdup(repo_id), (gpointer)dir_handle);
|
||||
|
||||
info = create_repo_watch_info (repo_id, worktree);
|
||||
g_hash_table_insert (priv->info_hash, (gpointer)(long)dir_handle, info);
|
||||
g_hash_table_insert (priv->info_hash, (gpointer)dir_handle, info);
|
||||
pthread_mutex_unlock (&priv->hash_lock);
|
||||
|
||||
add_event_to_queue (info->status, WT_EVENT_SCAN_DIR, "", NULL);
|
||||
|
12
lib/net.h
12
lib/net.h
@ -26,12 +26,12 @@
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define ECONNREFUSED WSAECONNREFUSED
|
||||
#define ECONNRESET WSAECONNRESET
|
||||
#define EHOSTUNREACH WSAEHOSTUNREACH
|
||||
#define EINPROGRESS WSAEINPROGRESS
|
||||
#define ENOTCONN WSAENOTCONN
|
||||
#define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
/* #define ECONNREFUSED WSAECONNREFUSED */
|
||||
/* #define ECONNRESET WSAECONNRESET */
|
||||
/* #define EHOSTUNREACH WSAEHOSTUNREACH */
|
||||
/* #define EINPROGRESS WSAEINPROGRESS */
|
||||
/* #define ENOTCONN WSAENOTCONN */
|
||||
/* #define EWOULDBLOCK WSAEWOULDBLOCK */
|
||||
#define sockerrno WSAGetLastError( )
|
||||
#else
|
||||
#include <errno.h>
|
||||
|
@ -781,7 +781,7 @@ writen(int fd, const void *vptr, size_t n)
|
||||
|
||||
|
||||
ssize_t /* Read "n" bytes from a descriptor. */
|
||||
recvn(int fd, void *vptr, size_t n)
|
||||
recvn(evutil_socket_t fd, void *vptr, size_t n)
|
||||
{
|
||||
size_t nleft;
|
||||
ssize_t nread;
|
||||
@ -810,7 +810,7 @@ recvn(int fd, void *vptr, size_t n)
|
||||
}
|
||||
|
||||
ssize_t /* Write "n" bytes to a descriptor. */
|
||||
sendn(int fd, const void *vptr, size_t n)
|
||||
sendn(evutil_socket_t fd, const void *vptr, size_t n)
|
||||
{
|
||||
size_t nleft;
|
||||
ssize_t nwritten;
|
||||
|
Loading…
Reference in New Issue
Block a user