summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorAjo Robert <ajo.robert@oracle.com>2016-01-07 14:36:19 +0530
committerAjo Robert <ajo.robert@oracle.com>2016-01-07 14:36:19 +0530
commit3d1306f7b74077cfa197c8fa23baeb96c535af67 (patch)
treed6c2dae346f0cbafed48ff2a04093f0fa654a99b /plugin
parent8c65e082f397a34cf393cfc6019daaa303ef5151 (diff)
downloadmariadb-git-3d1306f7b74077cfa197c8fa23baeb96c535af67.tar.gz
Bug#21770366 backport bug#21657078 to 5.5 and 5.6
Problem Statement ========= Fix various issues when building MySQL with Visual Studio 2015. Fix: ======= - Visual Studio 2015 adds support for timespec. Add check and related code to use this and only use our replacement if timespec is not defined. - Rename lfind/lsearch to my* to avoid redefinition problems. - Set default value for TMPDIR to "" on Windows as P_tmpdir no longer exists. - using VS definition of snprintf if available - tzname are now renamed to _tzname.
Diffstat (limited to 'plugin')
-rw-r--r--plugin/semisync/semisync_master.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc
index 2e40fc8b5c5..40d577e4372 100644
--- a/plugin/semisync/semisync_master.cc
+++ b/plugin/semisync/semisync_master.cc
@@ -1,6 +1,5 @@
/* Copyright (C) 2007 Google Inc.
- Copyright (c) 2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
- Use is subject to license terms.
+ Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -48,7 +47,7 @@ static int getWaitTime(const struct timespec& start_ts);
static unsigned long long timespec_to_usec(const struct timespec *ts)
{
-#ifndef __WIN__
+#ifdef HAVE_STRUCT_TIMESPEC
return (unsigned long long) ts->tv_sec * TIME_MILLION + ts->tv_nsec / TIME_THOUSAND;
#else
return ts->tv.i64 / 10;
@@ -683,7 +682,7 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name,
}
/* Calcuate the waiting period. */
-#ifdef __WIN__
+#ifndef HAVE_STRUCT_TIMESPEC
abstime.tv.i64 = start_ts.tv.i64 + (__int64)wait_timeout_ * TIME_THOUSAND * 10;
abstime.max_timeout_msec= (long)wait_timeout_;
#else