OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AtomSpaceInit.cc
Go to the documentation of this file.
1 /*
2  * opencog/atomspace/AtomSpaceInit.cc
3  *
4  * Copyright (C) 2008 by OpenCog Foundation
5  * All Rights Reserved
6  *
7  * Written by Gustavo Gama <gama@vettalabs.com>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU Affero General Public License v3 as
11  * published by the Free Software Foundation and including the exceptions
12  * at http://opencog.org/wiki/Licenses
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU Affero General Public License
20  * along with this program; if not, write to:
21  * Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  */
24 
26 
27 #if defined(WIN32) && defined(_DLL)
28 namespace win {
29 #include <windows.h>
30 };
31 
32 win::BOOL APIENTRY DllMain(win::HINSTANCE hinstDLL, // handle to DLL module
33  win::DWORD fdwReason, // reason for calling function
34  win::LPVOID lpvReserved) // reserved
35 {
36  System::setModuleHandle(hinstDLL);
37  switch(fdwReason) {
38  case DLL_PROCESS_ATTACH:
40  break;
41  case DLL_THREAD_ATTACH:
42  break;
43  case DLL_THREAD_DETACH:
44  break;
45  case DLL_PROCESS_DETACH:
46  break;
47  }
48  return TRUE;
49 }
50 #elif __GNUC__
51 #include <stdio.h>
52 static __attribute__ ((constructor)) void atomspace_init(void)
53 {
55 }
56 
57 static __attribute__ ((destructor)) void atomspace_fini(void)
58 {
59 }
60 
61 #endif
ClassServer & classserver(ClassServerFactory *=ClassServer::createInstance)
Definition: ClassServer.cc:159
static __attribute__((constructor)) void init(void)
Definition: ClassServer.cc:168