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 /***********************************************************************
    00012  Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by
    00013  MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc.
    00014  Others may also hold copyrights on code in this file.  See the CREDITS
    00015  file in the top directory of the distribution for details.
    00016
    00017  This file is part of MySQL++.
    00018
    00019  MySQL++ is free software; you can redistribute it and/or modify it
    00020  under the terms of the GNU Lesser General Public License as published
    00021  by the Free Software Foundation; either version 2.1 of the License, or
    00022  (at your option) any later version.
    00023
    00024  MySQL++ is distributed in the hope that it will be useful, but WITHOUT
    00025  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    00026  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
    00027  License for more details.
    00028
    00029  You should have received a copy of the GNU Lesser General Public
    00030  License along with MySQL++; if not, write to the Free Software
    00031  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
    00032  USA
    00033 ***********************************************************************/
    00034
    00035 #if !defined(DOXYGEN_IGNORE)
    00036 // Doxygen will not generate documentation for the following stuff.
    00037
    00038 #if defined(__WIN32__) || defined(_WIN32)
    00039 #       define MYSQLPP_PLATFORM_WINDOWS
    00040
    00041         // Windows compiler support.  Tested with Microsoft Visual C++,
    00042         // Borland C++ Builder, and MinGW GCC.
    00043 #       include <winsock.h>
    00044
    00045         // The shutdown_level argument was added in MySQL 4.1.3 and in 5.0.1.
    00046 #       if ((MYSQL_VERSION_ID > 40103) && (MYSQL_VERSION_ID < 49999)) || (MYSQL_VERSION_ID > 50001)
    00047 #               define HAVE_MYSQL_SHUTDOWN_LEVEL_ARG
    00048 #       endif
    00049
    00050         // Stuff for Visual C++ only
    00051 #       if defined(_MSC_VER)
    00052                 // Disable whining about using 'this' as a member initializer on VC++.
    00053 #               pragma warning(disable: 4355)
    00054                 // Disable whining about implicit conversions to bool
    00055 #               pragma warning(disable: 4800)
    00056                 // Call _snprintf() for VC++ version of snprintf() function
    00057 #               define snprintf _snprintf
    00058 #       endif
    00059
    00060         // Define DLL import/export tags for Windows compilers, where we build
    00061         // the library into a DLL, for LGPL license compatibility reasons.
    00062         // (This is based on a similar mechanism in wxWindows, which inspired
    00063         // this code, but which does things quite differently.)
    00064
    00065         #ifdef MYSQLPP_MAKING_DLL
    00066                 // When making the DLL, export tagged symbols, so they appear
    00067                 // in the import library.
    00068                 #define MYSQLPP_DLLEXPORT __declspec(dllexport)
    00069                 #define MYSQLPP_DLLEXPORT_DATA(type) __declspec(dllexport) type
    00070         #else
    00071                 // We must be using the DLL, so import symbols instead.
    00072                 #define MYSQLPP_DLLEXPORT __declspec(dllimport)
    00073                 #define MYSQLPP_DLLEXPORT_DATA(type) __declspec(dllimport) type
    00074         #endif
    00075 #else
    00076         // If not Windows, we assume some sort of Unixy build environment,
    00077         // where autotools is used.  (This includes Cygwin!)  #include the
    00078         // config.h file only if this file was included from a non-header
    00079         // file, because headers must not be dependent on config.h.
    00080 #       if defined(MYSQLPP_NOT_HEADER)
    00081 #               include "config.h"
    00082 #       endif
    00083
    00084         // Make DLL stuff a no-op on this platform.
    00085         #define MYSQLPP_DLLEXPORT
    00086         #define MYSQLPP_DLLEXPORT_DATA(type) type
    00087 #endif
    00088
    00089 #endif // !defined(DOXYGEN_IGNORE)