Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

platform.h

Go to the documentation of this file.
00001 
00002 
00003 //      remain unaware of platform differences.
00010 
00011 #if defined(__WIN32__) || defined(_WIN32)
00012         // Windows compiler support.  Tested with Microsoft Visual C++,
00013         // Borland C++ Builder, and MinGW GCC.
00014 #       include <winsock.h>
00015 
00016         // The shutdown_level argument was added in MySQL 4.1.3 and in 5.0.1.
00017 #       if ((MYSQL_VERSION_ID > 40103) && (MYSQL_VERSION_ID < 49999)) || (MYSQL_VERSION_ID > 50001)
00018 #               define HAVE_MYSQL_SHUTDOWN_LEVEL_ARG
00019 #       endif
00020 
00021         // Stuff for Visual C++ only
00022 #       if defined(_MSC_VER)
00023                 // Disable whining about using 'this' as a member initializer on VC++.
00024 #               pragma warning(disable: 4355)
00025                 // Disable whining about implicit conversions to bool
00026 #               pragma warning(disable: 4800)
00027                 // Call _snprintf() for VC++ version of snprintf() function
00028 #               define snprintf _snprintf
00029 #       endif
00030 #else
00031         // If not Windows, we assume some sort of Unixy build environment,
00032         // where autotools is used.  (This includes Cygwin!)  #include the
00033         // config.h file only if this file was included from a non-header
00034         // file, because headers must not be dependent on config.h.
00035 #       if defined(MYSQLPP_NOT_HEADER)
00036 #               include "config.h"
00037 #       endif
00038 #endif
00039 
00040 // Define DLL import/export tags for Windows compilers, where we build
00041 // the library into a DLL, for LGPL license compatibility reasons.
00042 // (This is based on a similar mechanism in wxWindows, which inspired
00043 // this code, but which does things quite differently.)
00044 #if defined(__WIN32__) || defined(_WIN32)
00045         #ifdef MYSQLPP_MAKING_DLL
00046                 // When making the DLL, export tagged symbols, so they appear
00047                 // in the import library.
00048                 #define MYSQLPP_DLLEXPORT __declspec(dllexport)
00049                 #define MYSQLPP_DLLEXPORT_DATA(type) __declspec(dllexport) type
00050         #else
00051                 // We must be using the DLL, so import symbols instead.
00052                 #define MYSQLPP_DLLEXPORT __declspec(dllimport)
00053                 #define MYSQLPP_DLLEXPORT_DATA(type) __declspec(dllimport) type
00054         #endif
00055 #else
00056         // Not on a platform where DLL is made, so make everything a no-op.
00057         #define MYSQLPP_DLLEXPORT
00058         #define MYSQLPP_DLLEXPORT_DATA(type) type
00059 #endif
00060 

Generated on Sat Apr 30 07:30:04 2005 for MySQL++ by doxygen1.2.18