ModuleUtils.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/common/ModuleUtils.h
22 
23  \brief Utility functions for module definition.
24 */
25 
26 #ifndef __TERRALIB_COMMON_INTERNAL_MODULEUTILS_H
27 #define __TERRALIB_COMMON_INTERNAL_MODULEUTILS_H
28 
29 //#if !TE_TERRALIB_STATIC_BUILD
30 // #if TE_COMPILER == TE_COMPILERCODE_VCPLUSPLUS
31 // #include <windows.h>
32 //
33 // #define TE_REGISTER_MODULE(moduleName, startupFunction, shutdownFunction) \
34 // BOOL WINAPI DllMain(HINSTANCE /*hinstDLL*/, DWORD fdwReason, LPVOID /*lpReserved*/) \
35 // { \
36 // switch(fdwReason) \
37 // { \
38 // case DLL_PROCESS_ATTACH: \
39 // startupFunction(); \
40 // break; \
41 // \
42 // case DLL_THREAD_ATTACH: \
43 // break; \
44 // \
45 // case DLL_THREAD_DETACH: \
46 // break; \
47 // \
48 // case DLL_PROCESS_DETACH: \
49 // shutdownFunction(); \
50 // break; \
51 // } \
52 // \
53 // return TRUE; \
54 // }
55 // #elif TE_COMPILER == TE_COMPILERCODE_GNUC
56 // #define TE_REGISTER_MODULE(moduleName, startupFunction, shutdownFunction) \
57 // void __attribute__ ((constructor)) TeInitialize ## moduleName(void) \
58 // { \
59 // startupFunction(); \
60 // } \
61 // \
62 // void __attribute__ ((destructor)) TeFinalize ## moduleName(void) \
63 // { \
64 // shutdownFunction(); \
65 // }
66 // #else
67 // #define TE_REGISTER_MODULE(moduleName, startupFunction, shutdownFunction)
68 // #endif
69 //
70 //#else
71 // #define TE_REGISTER_MODULE(moduleName, startupFunction, shutdownFunction)
72 //#endif // TE_TERRALIB_STATIC_BUILD
73 
74 #endif // __TERRALIB_COMMON_INTERNAL_MODULEUTILS_H
75