rtVTK  0.6.0
DLL.h
00001 
00002 /******************************************************************************
00003  * Copyright (c) 2012, Grove City College
00004  * All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions are
00008  * met:
00009  * 
00010  *  * Redistributions of source code must retain the above copyright
00011  *    notice, this list of conditions and the following disclaimer.
00012  *
00013  *  * Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in
00015  *    the documentation and/or other materials provided with the
00016  *    distribution.
00017  *
00018  *  * Neither the name of Grove City College nor the names of its
00019  *    contributors may be used to endorse or promote products derived
00020  *    from this software without specific prior written permission.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00023  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00024  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00025  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00026  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00027  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00028  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00029  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00030  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00031  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00032  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033  *
00034  */
00035 
00036 
00037 #ifndef StandAlone_DLL_h
00038 #define StandAlone_DLL_h
00039 
00040 #ifdef WIN32
00041 #  include <windows.h>
00042 #  define DECLSPEC          __declspec(dllexport)
00043 #  define dll_t             HMODULE
00044 #  define DLL_PREFIX        ""
00045 #  define DLL_EXT           ".dll"
00046 #  define DLL_EXT_LEN       4
00047 #  define loadLibrary(x)    LoadLibraryA(x)
00048 #  define getFunction(x, y) GetProcAddress(x, y)
00049 #  define freeLibrary(x)    FreeLibrary(x)
00050 #else
00051 #  include <dlfcn.h>
00052 #  define DECLSPEC
00053 #  define dll_t             void*
00054 #  define DLL_PREFIX        "lib"
00055 #  ifdef __APPLE__
00056 #    define DLL_EXT           ".dylib"
00057 #    define DLL_EXT_LEN       6
00058 #  else
00059 #    define DLL_EXT           ".so"
00060 #    define DLL_EXT_LEN       3
00061 #  endif // __APPLE__
00062 #  define loadLibrary(x)    dlopen(x, RTLD_NOW)
00063 #  define getFunction(x, y) dlsym(x, y)
00064 #  define freeLibrary(x)    dlclose(x)
00065 #endif // WIN32
00066 
00067 #endif // StandAlone_DLL_h
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends