libutil++  1.9.3
 All Classes Functions Variables
initfini.cpp
1 /*
2 ** libutil++
3 ** $Id: initfini.cpp 1653 2016-02-28 19:54:59Z sella $
4 ** Copyright (c) 2011-2016 Digital Genesis, LLC. All Rights Reserved.
5 ** Released under the LGPL Version 2.1 License.
6 ** http://www.digitalgenesis.com
7 */
8 
9 static const char rcsid[] __attribute__((used)) = "$Id: initfini.cpp 1653 2016-02-28 19:54:59Z sella $";
10 
11 #include "sella/util/Log.h"
12 
13 using namespace sella;
14 using namespace sella::util;
15 
16 extern "C" {
17  bool libutilxx__openssl_init = false;
18  bool libutilxx__exception_stacktrace = false;
19 
20  void __attribute__ ((constructor (101))) libutilxx__init(void) { /* 101 == Highest priority */
21  libutilxx__log = Log::instance();
22  }
23 
24  void __attribute__ ((destructor (65535))) libutilxx__fini(void) { /* 65535 == Lowest priority */
25  libutilxx__log.reset();
26 
27  if (libutilxx__openssl_init) { /* Cleanup, if in use. */
28  libutilxx__openssl_init = false;
29  }
30  }
31 }
32 
33 /*
34 ** vim: noet ts=3 sw=3
35 */