Commit ac380604 authored by unknown's avatar unknown

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
...@@ -247,13 +247,19 @@ extern int my_snprintf(char* to, size_t n, const char* fmt, ...); ...@@ -247,13 +247,19 @@ extern int my_snprintf(char* to, size_t n, const char* fmt, ...);
} }
#endif #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; char *str;
uint length; uint length;
}; } LEX_STRING;
#define STRING_WITH_LEN(X) (X), ((uint) (sizeof(X) - 1)) #define STRING_WITH_LEN(X) (X), ((uint) (sizeof(X) - 1))
#define C_STRING_WITH_SIZE(X) ((char *) (X)), ((uint) (sizeof(X) - 1)) #define C_STRING_WITH_SIZE(X) ((char *) (X)), ((uint) (sizeof(X) - 1))
......
...@@ -30,15 +30,14 @@ void IMService::Run(DWORD argc, LPTSTR *argv) ...@@ -30,15 +30,14 @@ void IMService::Run(DWORD argc, LPTSTR *argv)
// report to the SCM that we're about to start // report to the SCM that we're about to start
ReportStatus((DWORD)SERVICE_START_PENDING); ReportStatus((DWORD)SERVICE_START_PENDING);
Options o; Options::load(argc, argv);
o.load(argc, argv);
// init goes here // init goes here
ReportStatus((DWORD)SERVICE_RUNNING); ReportStatus((DWORD)SERVICE_RUNNING);
// wait for main loop to terminate // wait for main loop to terminate
manager(o); manager();
o.cleanup(); Options::cleanup();
} }
void IMService::Log(const char *msg) void IMService::Log(const char *msg)
......
...@@ -93,9 +93,6 @@ mysqlmanager_LDADD= @CLIENT_EXTRA_LDFLAGS@ \ ...@@ -93,9 +93,6 @@ mysqlmanager_LDADD= @CLIENT_EXTRA_LDFLAGS@ \
EXTRA_DIST = WindowsService.cpp WindowsService.h IMService.cpp \ EXTRA_DIST = WindowsService.cpp WindowsService.h IMService.cpp \
IMService.h cmakelists.txt IMService.h cmakelists.txt
AM_CFLAGS = -Werror
AM_CXXFLAGS = -Werror
tags: tags:
ctags -R *.h *.cc ctags -R *.h *.cc
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include "commands.h" #include "commands.h"
#include <my_global.h> #include <my_global.h>
#include <m_string.h>
#include <m_ctype.h> #include <m_ctype.h>
#include <mysql.h> #include <mysql.h>
#include <my_dir.h> #include <my_dir.h>
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <my_global.h> #include <my_global.h>
#include <my_sys.h> #include <my_sys.h>
#include <m_string.h>
#include <hash.h> #include <hash.h>
#include "command.h" #include "command.h"
...@@ -28,7 +29,6 @@ ...@@ -28,7 +29,6 @@
#pragma interface #pragma interface
#endif #endif
struct LEX_STRING;
/* /*
Print all instances of this instance manager. Print all instances of this instance manager.
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <my_global.h> #include <my_global.h>
#include <m_ctype.h> #include <m_ctype.h>
#include <mysql_com.h> #include <mysql_com.h>
#include <m_string.h>
#include "buffer.h" #include "buffer.h"
#include "guardian.h" #include "guardian.h"
...@@ -117,7 +116,7 @@ static void parse_option(const char *option_str, ...@@ -117,7 +116,7 @@ static void parse_option(const char *option_str,
char *option_name_buf, char *option_name_buf,
char *option_value_buf) char *option_value_buf)
{ {
char *eq_pos; const char *eq_pos;
const char *ptr= option_str; const char *ptr= option_str;
while (*ptr == '-') while (*ptr == '-')
......
...@@ -18,14 +18,13 @@ ...@@ -18,14 +18,13 @@
#include <my_global.h> #include <my_global.h>
#include <my_sys.h> #include <my_sys.h>
#include <m_string.h>
#include <hash.h> #include <hash.h>
#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE) #if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
#pragma interface #pragma interface
#endif #endif
struct LEX_STRING;
class Guardian_thread; class Guardian_thread;
class Instance; class Instance;
class Named_value_arr; class Named_value_arr;
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <my_sys.h> #include <my_sys.h>
#include "parse.h" #include "parse.h"
#include "portability.h" /* for pid_t on Win32 */
#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE) #if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
#pragma interface #pragma interface
......
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
#include "user_management_commands.h" #include "user_management_commands.h"
#ifdef __WIN__ #ifdef __WIN__
#include "windowsservice.h" #include "IMService.h"
#include "WindowsService.h"
#endif #endif
......
...@@ -216,7 +216,6 @@ int Add_user_cmd::execute() ...@@ -216,7 +216,6 @@ int Add_user_cmd::execute()
{ {
LEX_STRING user_name; LEX_STRING user_name;
const char *password; const char *password;
char scrambled_password_buf[SCRAMBLED_PASSWORD_CHAR_LENGTH + 1];
User_map user_map; User_map user_map;
User *new_user; User *new_user;
...@@ -310,7 +309,6 @@ int Edit_user_cmd::execute() ...@@ -310,7 +309,6 @@ int Edit_user_cmd::execute()
{ {
LEX_STRING user_name; LEX_STRING user_name;
const char *password; const char *password;
char scrambled_password_buf[SCRAMBLED_PASSWORD_CHAR_LENGTH + 1];
User_map user_map; User_map user_map;
User *user; User *user;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "user_map.h" #include "user_map.h"
#include "exit_codes.h" #include "exit_codes.h"
#include "log.h" #include "log.h"
#include "portability.h"
User::User(const LEX_STRING *user_name_arg, const char *password) User::User(const LEX_STRING *user_name_arg, const char *password)
{ {
......
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