source: rtems/testsuites/libtests/dl05/dl-load.h @ d2e31f7

4.11
Last change on this file since d2e31f7 was d2e31f7, checked in by Chris Johns <chrisj@…>, on 03/28/17 at 06:23:05

libdl: Back port C++ exception throw and catch from 4.12.

Closes #2956.

  • Property mode set to 100644
File size: 890 bytes
Line 
1/*
2 * Copyright (c) 2016 Chris Johns <chrisj@rtems.org>.  All rights reserved.
3 *
4 * The license and distribution terms for this file may be
5 * found in the file LICENSE in this distribution or at
6 * http://www.rtems.org/license/LICENSE.
7 */
8
9#if !defined(_DL_LOAD_H_)
10#define _DL_LOAD_H_
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16void exception_base(bool throw_runtime);
17void exception_dl(bool throw_runtime);
18
19int dl_load_test(void);
20
21#ifdef __cplusplus
22  class dl_test_throw_me
23  {
24  public:
25    dl_test_throw_me(const char* message) :
26      message (message) {
27    }
28    dl_test_throw_me(const dl_test_throw_me& orig) :
29      message (orig.message) {
30    }
31    dl_test_throw_me() :
32      message (0) {
33    }
34
35    ~dl_test_throw_me() {
36    }
37
38    const char* what() const {
39      return message;
40    }
41
42  private:
43    const char* message;
44  };
45#endif
46
47#ifdef __cplusplus
48}
49#endif
50
51#endif
Note: See TracBrowser for help on using the repository browser.