|
Packit Service |
17f749 |
/************************************************************************************
|
|
Packit Service |
17f749 |
Copyright (C) 2014 SkySQL AB
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
This library is free software; you can redistribute it and/or
|
|
Packit Service |
17f749 |
modify it under the terms of the GNU Library General Public
|
|
Packit Service |
17f749 |
License as published by the Free Software Foundation; either
|
|
Packit Service |
17f749 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
This library is distributed in the hope that it will be useful,
|
|
Packit Service |
17f749 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
17f749 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
17f749 |
Library General Public License for more details.
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
You should have received a copy of the GNU Library General Public
|
|
Packit Service |
17f749 |
License along with this library; if not see <http://www.gnu.org/licenses>
|
|
Packit Service |
17f749 |
or write to the Free Software Foundation, Inc.,
|
|
Packit Service |
17f749 |
51 Franklin St., Fifth Floor, Boston, MA 02110, USA
|
|
Packit Service |
17f749 |
*************************************************************************************/
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
/* MariaDB ODBC driver platform dependent declarations */
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
/* NOTE If you change something in this program, please consider if other platform's declaration
|
|
Packit Service |
17f749 |
require similar change */
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
/* Only one "platform" header is supposed to be included */
|
|
Packit Service |
17f749 |
#ifndef _ma_platform_x_h_
|
|
Packit Service |
17f749 |
# define _ma_platform_x_h_
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
/* Need size_t */
|
|
Packit Service |
17f749 |
#include <stdio.h>
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
#define __stdcall
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
#ifndef TRUE
|
|
Packit Service |
17f749 |
# define TRUE 1
|
|
Packit Service |
17f749 |
#endif
|
|
Packit Service |
17f749 |
#ifndef FALSE
|
|
Packit Service |
17f749 |
# define FALSE 0
|
|
Packit Service |
17f749 |
#endif
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
//#define HAVE_UNICODE
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
#define MADB_DRIVER_NAME "libmaodbc.so"
|
|
Packit Service |
17f749 |
#define CP_UTF8 65001
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
#define _strdup strdup
|
|
Packit Service |
17f749 |
#define _stricmp strcasecmp
|
|
Packit Service |
17f749 |
#define _strnicmp strncasecmp
|
|
Packit Service |
17f749 |
#define _atoi64(str) strtoll((str), NULL, 10)
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
#define _i64toa(a,b,c) longlong2str((a),(b),(c))
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
/* Mimicking of VS' _snprintf */
|
|
Packit Service |
17f749 |
int _snprintf(char *buffer, size_t count, const char *format, ...);
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
/* Error codes fo strcpy_s */
|
|
Packit Service |
17f749 |
#ifndef EINVAL
|
|
Packit Service |
17f749 |
# define EINVAL 22
|
|
Packit Service |
17f749 |
#endif
|
|
Packit Service |
17f749 |
#ifndef ERANGE
|
|
Packit Service |
17f749 |
# define ERANGE 34
|
|
Packit Service |
17f749 |
#endif
|
|
Packit Service |
17f749 |
int strcpy_s(char *dest, size_t buffer_size, const char *src);
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
#define strncpy_s(a,b,c,d) strncpy((a),(c),(b))
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
/* Critical section -> pthread mutex */
|
|
Packit Service |
17f749 |
#include <pthread.h>
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
#define CRITICAL_SECTION pthread_mutex_t
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
#define EnterCriticalSection(cs) pthread_mutex_lock((cs))
|
|
Packit Service |
17f749 |
#define LeaveCriticalSection(cs) pthread_mutex_unlock((cs))
|
|
Packit Service |
17f749 |
#define DeleteCriticalSection(cs) pthread_mutex_destroy((cs))
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
#ifndef TryEnterCriticalSection
|
|
Packit Service |
17f749 |
# define TryEnterCriticalSection !pthread_mutex_trylock
|
|
Packit Service |
17f749 |
#endif
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
void InitializeCriticalSection(CRITICAL_SECTION *cs);
|
|
Packit Service |
17f749 |
|
|
Packit Service |
17f749 |
#endif /*_ma_platform_x_h_ */
|
|
Packit Service |
17f749 |
|