Commit 1f947d4b authored by unknown's avatar unknown
Browse files

wl1744 - ndb on windows


ndb/include/ndb_global.h.in:
  remove defines and put them into basestring
ndb/src/common/logger/FileLogHandler.cpp:
  fix
ndb/src/common/logger/Logger.cpp:
  fix
ndb/src/common/portlib/win32/NdbMutex.c:
  fix
ndb/src/common/util/basestring_vsnprintf.c:
  fix
ndb/src/mgmapi/mgmapi.cpp:
  fix
ndb/src/mgmsrv/MgmtSrvr.cpp:
  fix
ndb/src/mgmsrv/Services.cpp:
  fix
ndb/test/ndbapi/Makefile.am:
  fix
ndb/tools/Makefile.am:
  fix
parent 74735b3d
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -13,11 +13,8 @@
#define PATH_MAX 256
#define DIR_SEPARATOR "\\"
#define MYSQLCLUSTERDIR "c:\\mysql\\mysql-cluster"
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#define HAVE_STRCASECMP
#define strcasecmp _strcmpi
#define strncasecmp _strncmpi
#pragma warning(disable: 4503 4786)
#else
#undef NDB_WIN32
+2 −2
Original line number Diff line number Diff line
@@ -206,9 +206,9 @@ FileLogHandler::setMaxSize(const BaseString &size) {
  long val = strtol(size.c_str(), &end, 0); /* XXX */
  if(size.c_str() == end)
    return false;
  if(strncasecmp("M", end, 1) == 0)
  if(end[0] == 'M')
    val *= 1024*1024;
  if(strncasecmp("k", end, 1) == 0)
  if(end[0] == 'k')
    val *= 1024;

  m_maxFileSize = val;
+7 −3
Original line number Diff line number Diff line
@@ -183,9 +183,13 @@ Logger::addHandler(const BaseString &logstring) {

    LogHandler *handler = NULL;

    if(type == "SYSLOG") {
#ifndef NDB_WIN32
    if(type == "SYSLOG")
    {
      handler = new SysLogHandler();
    } else if(type == "FILE")
    } else 
#endif
    if(type == "FILE")
      handler = new FileLogHandler();
    else if(type == "CONSOLE")
      handler = new ConsoleLogHandler();
+2 −1
Original line number Diff line number Diff line
@@ -65,7 +65,8 @@ int NdbMutex_Trylock(NdbMutex* p_mutex)
    int result = -1;
    if(p_mutex) 
    {
        result = (TryEnterCriticalSection(p_mutex) ? 0 : -1);
        result = NdbMutex_Lock(p_mutex);
	//(TryEnterCriticalSection(p_mutex) ? 0 : -1);
    }
    return result;
}
+13 −21
Original line number Diff line number Diff line
@@ -20,10 +20,12 @@
#include <basestring_vsnprintf.h>
#include <my_config.h>


/*
#ifdef _WINDOWS
#define SNPRINTF_RETURN_TRUNC
*/
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#endif

int
basestring_snprintf(char *str, size_t size, const char *format, ...)
{
@@ -35,16 +37,6 @@ basestring_snprintf(char *str, size_t size, const char *format, ...)
  return(ret);
}

#ifdef HAVE_SNPRINTF
  #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) vsnprintf(a,b,c,d)
#else
  #define SNPRINTF_RETURN_TRUNC
  /*  #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) my_vsnprintf(a,b,c,d)
   *  we would like to use my_vsnprintf but it does not have enough features
   *  Let's hope vsnprintf works anyways
   */
  #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) vsnprintf(a,b,c,d)
#endif
#ifdef SNPRINTF_RETURN_TRUNC
static char basestring_vsnprintf_buf[16*1024];
#endif
@@ -54,20 +46,20 @@ basestring_vsnprintf(char *str, size_t size, const char *format, va_list ap)
  if (size == 0)
  {
#ifdef SNPRINTF_RETURN_TRUNC
    return BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf,
    return vsnprintf(basestring_vsnprintf_buf,
		     sizeof(basestring_vsnprintf_buf),
		     format, ap);
#else
    char buf[1];
    return BASESTRING_VSNPRINTF_FUNC(buf, 1, format, ap);
    return vsnprintf(buf, 1, format, ap);
#endif
  }
  {
    int ret= BASESTRING_VSNPRINTF_FUNC(str, size, format, ap);
    int ret= vsnprintf(str, size, format, ap);
#ifdef SNPRINTF_RETURN_TRUNC
    if (ret == size-1 || ret == -1)
    {
      ret= BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf,
      ret= vsnprintf(basestring_vsnprintf_buf,
		     sizeof(basestring_vsnprintf_buf),
		     format, ap);
    }
Loading