annotate liboctave/util/lo-cutils.c @ 21236:5d23ea5c733a

eliminate configuration macros from lo-cutils.h * lo-cutils.h, lo-cutils.c (octave_w32_library_search): Delete. Don't include windows.h * oct-shlib.cc: (octave_w32_library_search): Delete extern decl. (octave_w32_shlib::octave_w32_shlib): Declare msg as const char*. (octave_w32_shlib::search): Call GetProcAddress directly.
author John W. Eaton <jwe@octave.org>
date Tue, 09 Feb 2016 13:37:25 -0500
parents f7d1050b9b53
children 40de9f8f23a6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
1 /*
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
2
19697
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
3 Copyright (C) 2000-2015 John W. Eaton
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
4
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
6
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6111
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6111
diff changeset
10 option) any later version.
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
11
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
15 for more details.
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
16
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6111
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6111
diff changeset
19 <http://www.gnu.org/licenses/>.
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
20
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
21 */
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
22
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
23 #ifdef HAVE_CONFIG_H
21202
f7121e111991 maint: indent #ifdef blocks in liboctave and src directories.
Rik <rik@octave.org>
parents: 21102
diff changeset
24 # include <config.h>
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
25 #endif
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
26
15226
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
27 #include "lo-error.h"
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
28
4290
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
29 /* This gives us a better chance of finding a prototype for strptime
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
30 on some systems. */
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
31
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
32 #if ! defined (_XOPEN_SOURCE)
21213
f7d1050b9b53 maint: Clean up various usages of #ifdef.
Rik <rik@octave.org>
parents: 21202
diff changeset
33 # define _XOPEN_SOURCE 1
4290
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
34 #endif
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
35
3803
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
36 #include <sys/types.h>
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
37 #include <unistd.h>
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
38
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
39 #include <stdlib.h>
3803
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
40 #include <string.h>
3706
6581e686f83f [project @ 2000-07-25 05:30:02 by jwe]
jwe
parents: 3613
diff changeset
41 #include <time.h>
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
42
11512
e4e82740e9cd prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents: 11006
diff changeset
43 #include "lo-cutils.h"
5453
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
44 #include "syswait.h"
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
45
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5453
diff changeset
46 OCTAVE_API void
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
47 octave_qsort (void *base, size_t n, size_t size,
10180
be952ce74023 bootstrap.conf fixes
John W. Eaton <jwe@octave.org>
parents: 10178
diff changeset
48 int (*cmp) (const void *, const void *))
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
49 {
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
50 qsort (base, n, size, cmp);
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
51 }
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
52
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5453
diff changeset
53 OCTAVE_API int
6111
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
54 octave_strcasecmp (const char *s1, const char *s2)
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
55 {
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
56 return strcasecmp (s1, s2);
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
57 }
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
58
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
59 OCTAVE_API int
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
60 octave_strncasecmp (const char *s1, const char *s2, size_t n)
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
61 {
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
62 return strncasecmp (s1, s2, n);
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
63 }
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
64
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5453
diff changeset
65 OCTAVE_API pid_t
5453
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
66 octave_waitpid (pid_t pid, int *status, int options)
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
67 {
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
68 return WAITPID (pid, status, options);
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
69 }
15221
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
70
15254
e8abaaaa2d7d avoid function defined but not used warning
John W. Eaton <jwe@octave.org>
parents: 15226
diff changeset
71 static inline void
21102
dfcb9d74b253 Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents: 19697
diff changeset
72 warn_missing_wait_macro (const char *id, int status)
15226
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
73 {
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
74 (*current_liboctave_warning_handler)
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
75 ("%s always returns false in this version of Octave; status = %d",
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
76 id, status);
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
77 }
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
78
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
79 OCTAVE_API int
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
80 octave_wifexited (int status)
15221
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
81 {
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
82 int retval = 0;
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
83
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
84 #if defined (WIFEXITED)
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
85 retval = WIFEXITED (status);
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
86 #else
21102
dfcb9d74b253 Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents: 19697
diff changeset
87 warn_missing_wait_macro ("WIFEXITED", status);
15221
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
88 #endif
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
89
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
90 return retval;
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
91 }
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
92
15226
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
93 OCTAVE_API int
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
94 octave_wexitstatus (int status)
15221
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
95 {
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
96 int retval = 0;
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
97
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
98 #if defined (WEXITSTATUS)
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
99 retval = WEXITSTATUS (status);
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
100 #else
21102
dfcb9d74b253 Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents: 19697
diff changeset
101 warn_missing_wait_macro ("WEXITSTATUS", status);
15221
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
102 #endif
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
103
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
104 return retval;
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
105 }
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
106
15226
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
107 OCTAVE_API int
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
108 octave_wifsignaled (int status)
15221
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
109 {
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
110 int retval = 0;
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
111
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
112 #if defined (WIFSIGNALED)
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
113 retval = WIFSIGNALED (status);
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
114 #else
21102
dfcb9d74b253 Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents: 19697
diff changeset
115 warn_missing_wait_macro ("WIFSIGNALED", status);
15221
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
116 #endif
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
117
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
118 return retval;
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
119 }
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
120
15226
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
121 OCTAVE_API int
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
122 octave_wtermsig (int status)
15221
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
123 {
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
124 int retval = 0;
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
125
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
126 #if defined (WTERMSIG)
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
127 retval = WTERMSIG (status);
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
128 #else
21102
dfcb9d74b253 Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents: 19697
diff changeset
129 warn_missing_wait_macro ("WTERMSIG", status);
15221
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
130 #endif
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
131
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
132 return retval;
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
133 }
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
134
15226
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
135 OCTAVE_API int
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
136 octave_wcoredump (int status)
15221
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
137 {
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
138 int retval = 0;
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
139
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
140 #if defined (WCOREDUMP)
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
141 retval = WCOREDUMP (status);
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
142 #else
21102
dfcb9d74b253 Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents: 19697
diff changeset
143 warn_missing_wait_macro ("WCOREDUMP", status);
15221
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
144 #endif
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
145
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
146 return retval;
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
147 }
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
148
15226
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
149 OCTAVE_API int
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
150 octave_wifstopped (int status)
15221
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
151 {
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
152 int retval = 0;
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
153
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
154 #if defined (WIFSTOPPED)
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
155 retval = WIFSTOPPED (status);
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
156 #else
21102
dfcb9d74b253 Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents: 19697
diff changeset
157 warn_missing_wait_macro ("WIFSTOPPED", status);
15221
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
158 #endif
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
159
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
160 return retval;
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
161 }
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
162
15226
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
163 OCTAVE_API int
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
164 octave_wstopsig (int status)
15221
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
165 {
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
166 int retval = 0;
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
167
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
168 #if defined (WSTOPSIG)
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
169 retval = WSTOPSIG (status);
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
170 #else
21102
dfcb9d74b253 Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents: 19697
diff changeset
171 warn_missing_wait_macro ("WSTOPSIG", status);
15221
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
172 #endif
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
173
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
174 return retval;
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
175 }
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
176
15226
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
177 OCTAVE_API int
a0af93de0ba3 fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents: 15221
diff changeset
178 octave_wifcontinued (int status)
15221
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
179 {
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
180 int retval = 0;
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
181
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
182 #if defined (WIFCONTINUED)
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
183 retval = WIFCONTINUED (status);
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
184 #else
21102
dfcb9d74b253 Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents: 19697
diff changeset
185 warn_missing_wait_macro ("WIFCONTINUED", status);
15221
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
186 #endif
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
187
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
188 return retval;
a83b7b2f95ee avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents: 14741
diff changeset
189 }