Commit e910d5dd authored by unknown's avatar unknown

wl1744- ndb windows

move ports into ndb_global


BitKeeper/deleted/.del-ndb_version.h~c759dd144f698ea:
  Delete: ndb/include/ndb_version.h
BitKeeper/deleted/.del-ndb_global.h~c4762a8c8f5136c6:
  Delete: ndb/include/ndb_global.h
configure.in:
  also generate ndb_global
ndb/include/ndb_types.h:
  fix
ndb/src/common/mgmcommon/Makefile.am:
  put port into ndb_global
ndb/src/mgmsrv/ConfigInfo.cpp:
  win
ndb/src/mgmsrv/Makefile.am:
  moved ports into ndb_global
ndb/src/ndbapi/ndberror.c:
  use my_snprintf
parent 5859af25
...@@ -3132,6 +3132,7 @@ AC_CONFIG_FILES(ndb/Makefile ndb/include/Makefile dnl ...@@ -3132,6 +3132,7 @@ AC_CONFIG_FILES(ndb/Makefile ndb/include/Makefile dnl
ndb/test/ndbapi/bank/Makefile dnl ndb/test/ndbapi/bank/Makefile dnl
ndb/test/tools/Makefile dnl ndb/test/tools/Makefile dnl
ndb/test/run-test/Makefile mysql-test/ndb/Makefile dnl ndb/test/run-test/Makefile mysql-test/ndb/Makefile dnl
ndb/include/ndb_version.h ndb/include/ndb_global.h dnl
) )
fi fi
...@@ -3153,7 +3154,6 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl ...@@ -3153,7 +3154,6 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
support-files/MacOSX/Makefile mysql-test/Makefile dnl support-files/MacOSX/Makefile mysql-test/Makefile dnl
netware/Makefile dnl netware/Makefile dnl
include/mysql_version.h dnl include/mysql_version.h dnl
ndb/include/ndb_version.h dnl
cmd-line-utils/Makefile dnl cmd-line-utils/Makefile dnl
cmd-line-utils/libedit/Makefile dnl cmd-line-utils/libedit/Makefile dnl
zlib/Makefile dnl zlib/Makefile dnl
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
#include <ndb_types.h> #include <ndb_types.h>
#define NDB_PORT "@ndb_port@"
#define NDB_TCP_BASE_PORT "@ndb_port_base@"
#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) #if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32)
#define NDB_WIN32 #define NDB_WIN32
#include <winsock2.h> #include <winsock2.h>
...@@ -12,6 +15,7 @@ ...@@ -12,6 +15,7 @@
#define PATH_MAX 256 #define PATH_MAX 256
#define DIR_SEPARATOR "\\" #define DIR_SEPARATOR "\\"
#define MYSQLCLUSTERDIR "c:\\mysql\\mysql-cluster"
#pragma warning(disable: 4503 4786) #pragma warning(disable: 4503 4786)
......
...@@ -40,16 +40,20 @@ typedef __SIZE_TYPE__ UintPtr; ...@@ -40,16 +40,20 @@ typedef __SIZE_TYPE__ UintPtr;
#ifdef HAVE_INTTYPES_H #ifdef HAVE_INTTYPES_H
#include <inttypes.h> #include <inttypes.h>
#endif #endif
#if defined(WIN32) || defined(NDB_WIN32)
typedef Uint32 UintPtr;
#else
typedef uintptr_t UintPtr;
#endif
#endif
#if defined(WIN32) || defined(NDB_WIN32) #if defined(WIN32) || defined(NDB_WIN32)
typedef unsigned __int64 Uint64; typedef unsigned __int64 Uint64;
typedef signed __int64 Int64; typedef signed __int64 Int64;
typedef Uint32 UintPtr;
typedef UintPtr ssize_t; typedef UintPtr ssize_t;
#else #else
typedef unsigned long long Uint64; typedef unsigned long long Uint64;
typedef signed long long Int64; typedef signed long long Int64;
typedef uintptr_t UintPtr;
#endif
#endif #endif
......
/* Copyright (C) 2003 MySQL AB
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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef NDB_VERSION_H
#define NDB_VERSION_H
#include <ndb_global.h>
#include <version.h>
#define MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0))
#define NDB_VERSION_D MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD)
#define NDB_VERSION_STRING (getVersionString(NDB_VERSION, NDB_VERSION_STATUS))
#define NDB_VERSION_TAG_STRING "$Name: $"
#define NDB_VERSION ndbGetOwnVersion()
/**
* Version id
*
* Used by transporter and when communicating with
* managment server
*/
/*#define NDB_VERSION_ID 0*/
#endif
...@@ -7,8 +7,6 @@ libmgmsrvcommon_la_SOURCES = \ ...@@ -7,8 +7,6 @@ libmgmsrvcommon_la_SOURCES = \
INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmapi -I$(top_srcdir)/ndb/src/mgmsrv INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmapi -I$(top_srcdir)/ndb/src/mgmsrv
DEFS_LOC = -DNDB_PORT="\"@ndb_port@\""
include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/common.mk.am
include $(top_srcdir)/ndb/config/type_ndbapi.mk.am include $(top_srcdir)/ndb/config/type_ndbapi.mk.am
include $(top_srcdir)/ndb/config/type_mgmapiclient.mk.am include $(top_srcdir)/ndb/config/type_mgmapiclient.mk.am
......
...@@ -3011,7 +3011,7 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ ...@@ -3011,7 +3011,7 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){
if(!(ctx.m_userDefaults && if(!(ctx.m_userDefaults &&
ctx.m_userDefaults->get("PortNumber", &base)) && ctx.m_userDefaults->get("PortNumber", &base)) &&
!ctx.m_systemDefaults->get("PortNumber", &base)) { !ctx.m_systemDefaults->get("PortNumber", &base)) {
base= strtoll(NDB_BASE_PORT,0,0); base= strtoll(NDB_TCP_BASE_PORT,0,0);
// ctx.reportError("Cannot retrieve base port number"); // ctx.reportError("Cannot retrieve base port number");
// return false; // return false;
} }
...@@ -3443,7 +3443,7 @@ static bool add_server_ports(Vector<ConfigInfo::ConfigRuleSection>&sections, ...@@ -3443,7 +3443,7 @@ static bool add_server_ports(Vector<ConfigInfo::ConfigRuleSection>&sections,
#if 0 #if 0
Properties * props= ctx.m_config; Properties * props= ctx.m_config;
Properties computers(true); Properties computers(true);
Uint32 port_base = NDB_BASE_PORT; Uint32 port_base = NDB_TCP_BASE_PORT;
Uint32 nNodes; Uint32 nNodes;
ctx.m_userProperties.get("NoOfNodes", &nNodes); ctx.m_userProperties.get("NoOfNodes", &nNodes);
......
...@@ -32,9 +32,7 @@ LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \ ...@@ -32,9 +32,7 @@ LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \
DEFS_LOC = -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \ DEFS_LOC = -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
-DDATADIR="\"$(MYSQLDATAdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \
-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
-DMYSQLCLUSTERDIR="\"$(MYSQLCLUSTERdir)\"" \ -DMYSQLCLUSTERDIR="\"$(MYSQLCLUSTERdir)\""
-DNDB_PORT="\"@ndb_port@\"" \
-DNDB_BASE_PORT="\"@ndb_port_base@\""
include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/common.mk.am
include $(top_srcdir)/ndb/config/type_ndbapi.mk.am include $(top_srcdir)/ndb/config/type_ndbapi.mk.am
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <ndb_global.h> #include <ndb_global.h>
#include <ndberror.h> #include <ndberror.h>
#include <basestring_vsnprintf.h>
typedef struct ErrorBundle { typedef struct ErrorBundle {
int code; int code;
...@@ -595,7 +594,7 @@ int ndb_error_string(int err_no, char *str, unsigned int size) ...@@ -595,7 +594,7 @@ int ndb_error_string(int err_no, char *str, unsigned int size)
ndberror_update(&error); ndberror_update(&error);
len = len =
basestring_snprintf(str, size-1, "%s: %s: %s", error.message, my_snprintf(str, size-1, "%s: %s: %s", error.message,
ndberror_status_message(error.status), ndberror_status_message(error.status),
ndberror_classification_message(error.classification)); ndberror_classification_message(error.classification));
str[size-1]= '\0'; str[size-1]= '\0';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment