Mercurial > octave
annotate libinterp/octave-value/ov-dld-fcn.cc @ 33636:3ec6fcce7715 default tip @
gui: Avoid using HAVE_QSCINTILLA in more header files.
* gui-settings.h, settings-dialog.h: Don't include QScintilla header.
Forward-declare QSciLexer class instead if necessary. Declare all member
functions unconditionally.
* gui-settings.cc (gui_settings::get_valid_lexer_styles,
gui_settings::read_lexer_settings),
settings-dialog.cc (settings_dialog::update_lexer,
settings_dialog::get_lexer_settings, settings_dialog::write_lexer_settings):
Define functions unconditionally.
* gui-preferences-ed.h: Don't include QScintilla header. Remove definition of
local variable os_eol_mode from header.
* gui-preferences-ed.cc (os_eol_mode): Move definition of local variable here.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Tue, 28 May 2024 14:54:58 +0200 |
parents | 2e484f9f1f18 |
children |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
32632
2e484f9f1f18
maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
31771
diff
changeset
|
3 // Copyright (C) 1996-2024 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
3329 | 25 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
26 #if defined (HAVE_CONFIG_H) |
21301
40de9f8f23a6
Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents:
21200
diff
changeset
|
27 # include "config.h" |
3329 | 28 #endif |
29 | |
29639
161daebce243
Mark compiled system functions correctly if OCTAVE_HOME is non-canonical (bug #60554).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29358
diff
changeset
|
30 #include "file-ops.h" |
3329 | 31 #include "oct-shlib.h" |
32 | |
25460
627d6bde9b8d
solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
25440
diff
changeset
|
33 #include "defaults.h" |
3329 | 34 #include "dynamic-ld.h" |
35 #include "error.h" | |
23627
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23518
diff
changeset
|
36 #include "interpreter-private.h" |
25460
627d6bde9b8d
solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
25440
diff
changeset
|
37 #include "ovl.h" |
3329 | 38 #include "ov-dld-fcn.h" |
39 #include "ov.h" | |
40 | |
41 | |
42 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_dld_function, | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10184
diff
changeset
|
43 "dynamically-linked function", |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10184
diff
changeset
|
44 "dynamically-linked function"); |
3329 | 45 |
46 octave_dld_function::octave_dld_function | |
31607
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31105
diff
changeset
|
47 (octave_builtin::fcn ff, const octave::dynamic_library& shl, |
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31105
diff
changeset
|
48 const std::string& nm, const std::string& ds) |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
30034
diff
changeset
|
49 : octave_builtin (ff, nm, ds), m_sh_lib (shl) |
3329 | 50 { |
51 mark_fcn_file_up_to_date (time_parsed ()); | |
52 | |
3523 | 53 std::string file_name = fcn_file_name (); |
3329 | 54 |
29643
874430de1cc7
Fix error if test suite is run before Octave is installed (bug #60554).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29639
diff
changeset
|
55 static const std::string canonical_oct_file_dir |
874430de1cc7
Fix error if test suite is run before Octave is installed (bug #60554).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29639
diff
changeset
|
56 = octave::sys::canonicalize_file_name (octave::config::oct_file_dir ()); |
29639
161daebce243
Mark compiled system functions correctly if OCTAVE_HOME is non-canonical (bug #60554).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29358
diff
changeset
|
57 static const std::string oct_file_dir |
29643
874430de1cc7
Fix error if test suite is run before Octave is installed (bug #60554).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29639
diff
changeset
|
58 = canonical_oct_file_dir.empty () ? octave::config::oct_file_dir () |
31607
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31105
diff
changeset
|
59 : canonical_oct_file_dir; |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23627
diff
changeset
|
60 |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
30034
diff
changeset
|
61 m_system_fcn_file |
3329 | 62 = (! file_name.empty () |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23627
diff
changeset
|
63 && oct_file_dir == file_name.substr (0, oct_file_dir.length ())); |
3329 | 64 } |
65 | |
23518 | 66 octave_dld_function::octave_dld_function |
31607
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31105
diff
changeset
|
67 (octave_builtin::meth mm, const octave::dynamic_library& shl, |
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31105
diff
changeset
|
68 const std::string& nm, const std::string& ds) |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
30034
diff
changeset
|
69 : octave_builtin (mm, nm, ds), m_sh_lib (shl) |
23518 | 70 { |
71 mark_fcn_file_up_to_date (time_parsed ()); | |
72 | |
73 std::string file_name = fcn_file_name (); | |
74 | |
29643
874430de1cc7
Fix error if test suite is run before Octave is installed (bug #60554).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29639
diff
changeset
|
75 static const std::string canonical_oct_file_dir |
874430de1cc7
Fix error if test suite is run before Octave is installed (bug #60554).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29639
diff
changeset
|
76 = octave::sys::canonicalize_file_name (octave::config::oct_file_dir ()); |
29639
161daebce243
Mark compiled system functions correctly if OCTAVE_HOME is non-canonical (bug #60554).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29358
diff
changeset
|
77 static const std::string oct_file_dir |
29643
874430de1cc7
Fix error if test suite is run before Octave is installed (bug #60554).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29639
diff
changeset
|
78 = canonical_oct_file_dir.empty () ? octave::config::oct_file_dir () |
31607
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31105
diff
changeset
|
79 : canonical_oct_file_dir; |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23627
diff
changeset
|
80 |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
30034
diff
changeset
|
81 m_system_fcn_file |
23518 | 82 = (! file_name.empty () |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23627
diff
changeset
|
83 && oct_file_dir == file_name.substr (0, oct_file_dir.length ())); |
23518 | 84 } |
85 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
86 octave_dld_function::~octave_dld_function () |
3329 | 87 { |
31105
670a0d878af1
eliminate WHO arguments from interpreter-private functions
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
88 octave::dynamic_loader& dyn_loader = octave::__get_dynamic_loader__ (); |
23627
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23518
diff
changeset
|
89 |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
30034
diff
changeset
|
90 dyn_loader.remove_oct (m_name, m_sh_lib); |
3329 | 91 } |
92 | |
3536 | 93 std::string |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
94 octave_dld_function::fcn_file_name () const |
3329 | 95 { |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
30034
diff
changeset
|
96 return m_sh_lib.file_name (); |
3329 | 97 } |
98 | |
21730
30c53770f47e
use namespace for system time classes
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
99 octave::sys::time |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
100 octave_dld_function::time_parsed () const |
3329 | 101 { |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
30034
diff
changeset
|
102 return m_sh_lib.time_loaded (); |
3329 | 103 } |
104 | |
7349 | 105 // Note: this wrapper around the octave_dld_function constructor is |
106 // necessary to work around a MSVC limitation handling in | |
107 // virtual destructors that prevents unloading a dynamic module | |
108 // before *all* objects (of class using a virtual dtor) have | |
109 // been fully deleted; indeed, MSVC attaches auto-generated code | |
110 // (scalar deleting destructor) to objects created in a dynamic | |
111 // module, and this code will be executed in the dynamic module | |
112 // context at object deletion; unloading the dynamic module | |
113 // before objects have been deleted will make the "delete" code | |
114 // of objects to point to an invalid code segment. | |
115 | |
30390
a61e1a0f6024
maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30077
diff
changeset
|
116 octave_dld_function * |
22407
34ce5be04942
maint: Style check C++ code in libinterp/.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
117 octave_dld_function::create (octave_builtin::fcn ff, |
34ce5be04942
maint: Style check C++ code in libinterp/.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
118 const octave::dynamic_library& shl, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10184
diff
changeset
|
119 const std::string& nm, const std::string& ds) |
7349 | 120 { |
121 return new octave_dld_function (ff, shl, nm, ds); | |
122 } | |
23518 | 123 |
30390
a61e1a0f6024
maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30077
diff
changeset
|
124 octave_dld_function * |
23518 | 125 octave_dld_function::create (octave_builtin::meth mm, |
126 const octave::dynamic_library& shl, | |
127 const std::string& nm, const std::string& ds) | |
128 { | |
129 return new octave_dld_function (mm, shl, nm, ds); | |
130 } |