annotate examples/unwinddemo.cc @ 18840:4a4edf0f2077 nkf-ready

fix LLVM 3.4 build (bug #41061) * configure.ac: Call new functions OCTAVE_LLVM_RAW_FD_OSTREAM_API and OCTAVE_LLVM_LEGACY_PASSMANAGER_API, check for Verifier.h header file * m4/acinclude.m4 (OCTAVE_LLVM_RAW_FD_OSTREAM_API): New function to detect correct raw_fd_ostream API * m4/acinclude.m4 (OCTAVE_LLVM_LEGACY_PASSMANAGER_API): New function to detect legacy passmanager API * libinterp/corefcn/jit-util.h: Use legacy passmanager namespace if necessary * libinterp/corefcn/pt-jit.h (class tree_jit): Use legacy passmanager class if necessary * libinterp/corefcn/pt-jit.cc: Include appropriate header files * libinterp/corefcn/pt-jit.cc (tree_jit::initialize): Use legacy passmanager if necessary * libinterp/corefcn/pt-jit.cc (tree_jit::optimize): Use correct API * libinterp/corefcn/jit-typeinfo.cc: Include appropriate header file
author Stefan Mahr <dac922@gmx.de>
date Sun, 11 May 2014 02:28:33 +0200
parents be41c30bcb44
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6572
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
1 #include <octave/oct.h>
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
2 #include <octave/unwind-prot.h>
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
3
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
4 void
16867
be41c30bcb44 Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents: 14855
diff changeset
5 my_err_handler (const char *fmt, ...)
6572
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
6 {
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
7 // Do nothing!!
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
8 }
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
9
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
10 DEFUN_DLD (unwinddemo, args, nargout, "Unwind Demo")
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
11 {
16867
be41c30bcb44 Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents: 14855
diff changeset
12 octave_value retval;
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 12174
diff changeset
13 int nargin = args.length ();
16867
be41c30bcb44 Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents: 14855
diff changeset
14
6572
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
15 if (nargin < 2)
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
16 print_usage ();
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
17 else
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
18 {
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
19 NDArray a = args(0).array_value ();
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
20 NDArray b = args(1).array_value ();
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
21
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
22 if (! error_state)
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
23 {
16867
be41c30bcb44 Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents: 14855
diff changeset
24 // Declare unwind_protect frame which lasts as long as
be41c30bcb44 Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents: 14855
diff changeset
25 // the variable frame has scope.
be41c30bcb44 Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents: 14855
diff changeset
26 unwind_protect frame;
be41c30bcb44 Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents: 14855
diff changeset
27 frame.protect_var (current_liboctave_warning_handler);
be41c30bcb44 Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents: 14855
diff changeset
28
be41c30bcb44 Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents: 14855
diff changeset
29 set_liboctave_warning_handler (my_err_handler);
6572
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
30 retval = octave_value (quotient (a, b));
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
31 }
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
32 }
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
33 return retval;
8e7148b84b59 [project @ 2007-04-25 04:13:44 by jwe]
jwe
parents:
diff changeset
34 }