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

Generated on Thu May 5 05:30:43 2005 for MySQL++ by doxygen1.2.18