Commit ac380604 authored by unknown's avatar unknown
Browse files

Fix compilation problems on Windows and SUN Solaris.


include/m_string.h:
  Fix declaration of C-structure for Visual Studio and Sun C-compiler.
server-tools/instance-manager/IMService.cpp:
  Fixed.
server-tools/instance-manager/Makefile.am:
  Removed gcc-specific flags.
server-tools/instance-manager/commands.cc:
  Moved m_string.h to the header.
server-tools/instance-manager/commands.h:
  Replaced forward declaration of LEX_STRING because
  it is not understood by all compilers.
server-tools/instance-manager/instance_map.cc:
  1. Moved m_string.h to the header.
  2. Use (const char *) to point to const C-string.
server-tools/instance-manager/instance_map.h:
  Replaced forward declaration of LEX_STRING because
  it is not understood by all compilers.
server-tools/instance-manager/instance_options.h:
  Fixed headers.
server-tools/instance-manager/mysqlmanager.cc:
  Fixed headers.
server-tools/instance-manager/user_management_commands.cc:
  Removed unused variables.
server-tools/instance-manager/user_map.cc:
  Fixed headers.
parent 401d3a07
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -247,13 +247,19 @@ extern int my_snprintf(char* to, size_t n, const char* fmt, ...);
}
#endif

/* LEX_STRING */
/*
  LEX_STRING -- a pair of a C-string and its length.

  NOTE: this exactly form of declaration is required for some C-compilers
  (for one, Sun C 5.7 2005/01/07). Unfortunatelt with such declaration
  LEX_STRING can not be forward declared.
*/

typedef struct LEX_STRING
typedef struct
{
  char *str;
  uint length;
};
} LEX_STRING;

#define STRING_WITH_LEN(X) (X), ((uint) (sizeof(X) - 1))
#define C_STRING_WITH_SIZE(X) ((char *) (X)), ((uint) (sizeof(X) - 1))
+3 −4
Original line number Diff line number Diff line
@@ -30,15 +30,14 @@ void IMService::Run(DWORD argc, LPTSTR *argv)
  // report to the SCM that we're about to start
  ReportStatus((DWORD)SERVICE_START_PENDING);

  Options o;
  o.load(argc, argv);
  Options::load(argc, argv);

  // init goes here
  ReportStatus((DWORD)SERVICE_RUNNING);

  // wait for main loop to terminate
  manager(o);
  o.cleanup();
  manager();
  Options::cleanup();
}

void IMService::Log(const char *msg)
+0 −3
Original line number Diff line number Diff line
@@ -93,9 +93,6 @@ mysqlmanager_LDADD= @CLIENT_EXTRA_LDFLAGS@ \
EXTRA_DIST =		WindowsService.cpp WindowsService.h IMService.cpp \
			IMService.h cmakelists.txt

AM_CFLAGS = -Werror
AM_CXXFLAGS = -Werror

tags:
	ctags -R *.h *.cc

+0 −1
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@
#include "commands.h"

#include <my_global.h>
#include <m_string.h>
#include <m_ctype.h>
#include <mysql.h>
#include <my_dir.h>
+1 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@

#include <my_global.h>
#include <my_sys.h>
#include <m_string.h>
#include <hash.h>

#include "command.h"
@@ -28,7 +29,6 @@
#pragma interface
#endif

struct LEX_STRING;

/*
  Print all instances of this instance manager.
Loading