mirror of
https://github.com/MariaDB/server.git
synced 2025-01-27 01:04:19 +01:00
wl1744 - ndb windoze port
ndb/include/ndb_types.h: ndb windoze ndb/src/common/util/version.c: ndb windoze ndb/src/mgmsrv/ConfigInfo.cpp: ndb windoze ndb/src/ndbapi/ndberror.c: ndb windoze
This commit is contained in:
parent
4a3e1d1aed
commit
fe2a47b240
4 changed files with 11 additions and 6 deletions
|
@ -40,15 +40,17 @@ typedef __SIZE_TYPE__ UintPtr;
|
|||
#ifdef HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
typedef uintptr_t UintPtr;
|
||||
#endif
|
||||
|
||||
#if defined(WIN32) || defined(NDB_WIN32)
|
||||
typedef unsigned __int64 Uint64;
|
||||
typedef signed __int64 Int64;
|
||||
typedef Uint32 UintPtr;
|
||||
typedef UintPtr ssize_t;
|
||||
#else
|
||||
typedef unsigned long long Uint64;
|
||||
typedef signed long long Int64;
|
||||
typedef uintptr_t UintPtr;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include <ndb_global.h>
|
||||
#include <ndb_version.h>
|
||||
#include <version.h>
|
||||
#include <basestring_vsnprintf.h>
|
||||
|
||||
Uint32 getMajor(Uint32 version) {
|
||||
return (version >> 16) & 0xFF;
|
||||
|
@ -38,14 +39,14 @@ Uint32 makeVersion(Uint32 major, Uint32 minor, Uint32 build) {
|
|||
const char * getVersionString(Uint32 version, const char * status) {
|
||||
char buff[100];
|
||||
if (status && status[0] != 0)
|
||||
snprintf(buff, sizeof(buff),
|
||||
basestring_snprintf(buff, sizeof(buff),
|
||||
"Version %d.%d.%d (%s)",
|
||||
getMajor(version),
|
||||
getMinor(version),
|
||||
getBuild(version),
|
||||
status);
|
||||
else
|
||||
snprintf(buff, sizeof(buff),
|
||||
basestring_snprintf(buff, sizeof(buff),
|
||||
"Version %d.%d.%d",
|
||||
getMajor(version),
|
||||
getMinor(version),
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include <mgmapi_config_parameters.h>
|
||||
#include <ndb_limits.h>
|
||||
#include "InitConfigFileParser.hpp"
|
||||
#include <m_string.h>
|
||||
|
||||
#define MAX_LINE_LENGTH 255
|
||||
#define KEY_INTERNAL 0
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include <ndb_global.h>
|
||||
#include <ndberror.h>
|
||||
#include <basestring_vsnprintf.h>
|
||||
|
||||
typedef struct ErrorBundle {
|
||||
int code;
|
||||
|
@ -594,7 +595,7 @@ int ndb_error_string(int err_no, char *str, unsigned int size)
|
|||
ndberror_update(&error);
|
||||
|
||||
len =
|
||||
snprintf(str, size-1, "%s: %s: %s", error.message,
|
||||
basestring_snprintf(str, size-1, "%s: %s: %s", error.message,
|
||||
ndberror_status_message(error.status),
|
||||
ndberror_classification_message(error.classification));
|
||||
str[size-1]= '\0';
|
||||
|
|
Loading…
Add table
Reference in a new issue