Skip to content

Commit

Permalink
Remove Windows support which was broken in 1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
akopytov committed Apr 21, 2018
1 parent 565e93c commit 3a5475b
Show file tree
Hide file tree
Showing 28 changed files with 18 additions and 921 deletions.
11 changes: 0 additions & 11 deletions README-WIN.txt

This file was deleted.

113 changes: 0 additions & 113 deletions src/CMakeLists.txt

This file was deleted.

3 changes: 0 additions & 3 deletions src/db_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef _WIN32
#include "sb_win.h"
#endif
#ifdef STDC_HEADERS
# include <ctype.h>
# include <inttypes.h>
Expand Down
2 changes: 0 additions & 2 deletions src/drivers/mysql/CMakeLists.txt

This file was deleted.

3 changes: 0 additions & 3 deletions src/drivers/mysql/drv_mysql.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef _WIN32
#include <winsock2.h>
#endif

#ifdef HAVE_STRING_H
# include <string.h>
Expand Down
5 changes: 2 additions & 3 deletions src/sb_barrier.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexey Kopytov <[email protected]>
Copyright (C) 2016-2018 Alexey Kopytov <[email protected]>
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
Expand All @@ -19,8 +19,7 @@
/*
Thread barrier implementation. It differs from pthread_barrier_t in two ways:
- it's more portable (will also work on OS X and Windows with existing
pthread_* wrappers in sb_win.c).
- it's more portable (will also work on OS X).
- it allows defining a callback function which is called right before
signaling the participating threads to continue, i.e. as soon as the
Expand Down
6 changes: 1 addition & 5 deletions src/sb_barrier.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexey Kopytov <[email protected]>
Copyright (C) 2016-2018 Alexey Kopytov <[email protected]>
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
Expand Down Expand Up @@ -29,10 +29,6 @@
# include <pthread.h>
#endif

#ifdef _WIN32
#include "sb_win.h"
#endif

#define SB_BARRIER_SERIAL_THREAD 1

typedef int (*sb_barrier_cb_t)(void *);
Expand Down
5 changes: 1 addition & 4 deletions src/sb_histogram.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2011-2017 Alexey Kopytov.
/* Copyright (C) 2011-2018 Alexey Kopytov.
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
Expand All @@ -18,9 +18,6 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef _WIN32
#include "sb_win.h"
#endif

#ifdef STDC_HEADERS
# include <stdio.h>
Expand Down
22 changes: 2 additions & 20 deletions src/sb_logger.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Copyright (C) 2004 MySQL AB
Copyright (C) 2004-2017 Alexey Kopytov <[email protected]>
Copyright (C) 2004-2018 Alexey Kopytov <[email protected]>
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
Expand All @@ -19,9 +19,6 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef _WIN32
#include "sb_win.h"
#endif

#ifdef STDC_HEADERS
# include <stdio.h>
Expand Down Expand Up @@ -372,16 +369,6 @@ void log_errno(log_msg_priority_t priority, const char *fmt, ...)
int old_errno;
char *tmp;

#ifdef _WIN32
LPVOID lpMsgBuf;
old_errno = GetLastError();
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, old_errno,
0, (LPTSTR)&lpMsgBuf, 0, NULL);
tmp = (char *)lpMsgBuf;
#else
old_errno = errno;
#ifdef HAVE_STRERROR_R
#ifdef STRERROR_R_CHAR_P
Expand All @@ -394,8 +381,7 @@ void log_errno(log_msg_priority_t priority, const char *fmt, ...)
strncpy(errbuf, strerror(old_errno), sizeof(errbuf));
tmp = errbuf;
#endif /* HAVE_STRERROR_P */
#endif /* WIN32 */


va_start(ap, fmt);
n = vsnprintf(buf, TEXT_BUFFER_SIZE, fmt, ap);
va_end(ap);
Expand All @@ -404,10 +390,6 @@ void log_errno(log_msg_priority_t priority, const char *fmt, ...)
snprintf(buf + n, TEXT_BUFFER_SIZE - n, " errno = %d (%s)", old_errno,
tmp);

#ifdef _WIN32
LocalFree(lpMsgBuf);
#endif

log_text(priority, "%s", buf);
}

Expand Down
3 changes: 0 additions & 3 deletions src/sb_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef _WIN32
# include "sb_win.h"
#endif

#ifdef STDC_HEADERS
# include <stdio.h>
Expand Down
6 changes: 1 addition & 5 deletions src/sb_thread.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexey Kopytov <[email protected]>
Copyright (C) 2016-2018 Alexey Kopytov <[email protected]>
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
Expand All @@ -25,10 +25,6 @@
# include "config.h"
#endif

#ifdef _WIN32
#include "sb_win.h"
#endif

#ifdef HAVE_PTHREAD_H
# include <pthread.h>
#endif
Expand Down
6 changes: 1 addition & 5 deletions src/sb_thread.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexey Kopytov <[email protected]>
Copyright (C) 2016-2018 Alexey Kopytov <[email protected]>
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
Expand Down Expand Up @@ -28,10 +28,6 @@
# include "config.h"
#endif

#ifdef _WIN32
#include "sb_win.h"
#endif

#ifdef HAVE_PTHREAD_H
# include <pthread.h>
#endif
Expand Down
6 changes: 1 addition & 5 deletions src/sb_timer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Copyright (C) 2004 MySQL AB
Copyright (C) 2004-2017 Alexey Kopytov <[email protected]>
Copyright (C) 2004-2018 Alexey Kopytov <[email protected]>
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
Expand All @@ -23,10 +23,6 @@
# include "config.h"
#endif

#ifdef _WIN32
#include "sb_win.h"
#endif

#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
Expand Down
14 changes: 1 addition & 13 deletions src/sb_util.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2017 Alexey Kopytov <[email protected]>
Copyright (C) 2017-2018 Alexey Kopytov <[email protected]>
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
Expand All @@ -20,10 +20,6 @@
# include "config.h"
#endif

#ifdef _WIN32
#include "sb_win.h"
#endif

#ifdef STDC_HEADERS
# include <stdlib.h>
# include <inttypes.h>
Expand Down Expand Up @@ -55,10 +51,6 @@ void *sb_memalign(size_t size, size_t alignment)
/* Allocate on page boundary */
(void) alignment; /* unused */
buffer = valloc(size);
#elif defined (_WIN32)
/* Allocate on page boundary */
(void) alignment; /* unused */
buffer = VirtualAlloc(NULL, size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE);
#else
# error Cannot find an aligned allocation library function!
#endif
Expand All @@ -72,10 +64,6 @@ size_t sb_getpagesize(void)
{
#ifdef _SC_PAGESIZE
return sysconf(_SC_PAGESIZE);
#elif defined _WIN32
SYSTEM_INFO info;
GetSystemInfo(&info);
return info.dwPageSize;
#else
return getpagesize();
#endif
Expand Down
Loading

0 comments on commit 3a5475b

Please sign in to comment.