Mercurial > octave
annotate liboctave/system/lo-sysdep.h @ 21949:baeffde5c87d
fix build for Windows systems
* file-stat.cc, oct-syscalls.cc, syscalls.cc: Include <ctime>.
* sysdep.cc: Include <shellapi.h> for Windows.
* lo-sysdep.cc: Include <fcntl.h> and <io.h> for Windows.
* wait-wrappers.c (WIFCONTINUED): Define if sys/wait.h does not.
* signal-wrappers.c (octave_kill_wrapper): Return -1 if kill is missing.
* main.in.cc (prepare_spawn): Move to unistd-wrappers.c.
(octave_exec): Eliminate special case for Windows.
(main): Display message if exec fails.
* unistd-wrappers.h, fcntl-wrappers.h, lo-sysdep.h:
Include <sys/types.h>
* unistd-wrappers.c (octave_execv_wrapper): Handle Windows
implementation here. Free sanitized command vector if spawnv fails.
(octave_getegid_wrapper): Return -1 if getegid is missing.
(octave_geteuid_wrapper): Return -1 if geteuid is missing.
(octave_getgid_wrapper): Return -1 if getgid is missing.
(octave_getpgrp_wrapper): Return -1 if getpgrp is missing.
(octave_getpid_wrapper): Return -1 if getpid is missing.
(octave_getppid_wrapper): Return -1 if getppid is missing.
(octave_getuid_wrapper): Return -1 if getuid is missing.
(octave_setsid_wrapper): Return -1 if setsid is missing.
* configure.ac: Check for setsid.
* lo-sysdep.cc (win_popen2): Move to octave-popen2.c.
* lo-sysdep.h (win_popen2): Delete decl.
(octave_popen2): Delete deprecated function pointer.
* octave-popen2, octave-popen2.c (octave_popen2): New arg, ERRMSG.
Handle Windows implemenation here.
(make_command_string): New static function.
* oct-syscalls.cc (octave::sys::popen2): Eliminate special case for
Windows. Defined deprecated inline functions for old octave_popen2
interface.
* quit.h: Don't include <windows.h>.
(w32_sigint_init, w32_raise_final, w32_raise, w32_in_main_thread):
Delete decls of undefined and unused functions.
* toplev.cc: Include <windows.h>.
* sysdep.cc: Include <windows.h> before <tlhelp32.h> and <shellapi.h>.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 18 Jun 2016 10:55:49 -0400 |
parents | 590c39b94618 |
children | bac0d6f07a3e |
rev | line source |
---|---|
2926 | 1 /* |
2 | |
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
17822
diff
changeset
|
3 Copyright (C) 1996-2015 John W. Eaton |
2926 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
2926 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
2926 | 20 |
21 */ | |
22 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
23 #if ! defined (octave_lo_sysdep_h) |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17769
diff
changeset
|
24 #define octave_lo_sysdep_h 1 |
2926 | 25 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
26 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
27 |
2926 | 28 #include <string> |
29 | |
21949
baeffde5c87d
fix build for Windows systems
John W. Eaton <jwe@octave.org>
parents:
21828
diff
changeset
|
30 #include <sys/types.h> |
baeffde5c87d
fix build for Windows systems
John W. Eaton <jwe@octave.org>
parents:
21828
diff
changeset
|
31 |
2926 | 32 #include "lo-ieee.h" |
21738
a99c2407f930
use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
33 |
6321 | 34 class string_vector; |
2926 | 35 |
21738
a99c2407f930
use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
36 namespace octave |
a99c2407f930
use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
37 { |
a99c2407f930
use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
38 namespace sys |
a99c2407f930
use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
39 { |
a99c2407f930
use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
40 extern std::string getcwd (void); |
2926 | 41 |
21738
a99c2407f930
use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
42 extern int chdir (const std::string&); |
a99c2407f930
use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
43 } |
a99c2407f930
use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
44 } |
a99c2407f930
use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
45 |
a99c2407f930
use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
46 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS) |
a99c2407f930
use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
47 |
21752
949cb46e6bdb
use consistent style for deprecated function/class messages
John W. Eaton <jwe@octave.org>
parents:
21738
diff
changeset
|
48 OCTAVE_DEPRECATED ("use 'octave::sys::getcwd' instead") |
21738
a99c2407f930
use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
49 const auto octave_getcwd = octave::sys::getcwd; |
a99c2407f930
use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
50 |
21752
949cb46e6bdb
use consistent style for deprecated function/class messages
John W. Eaton <jwe@octave.org>
parents:
21738
diff
changeset
|
51 OCTAVE_DEPRECATED ("use 'octave::sys::chdir' instead") |
21738
a99c2407f930
use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
52 const auto octave_chdir = octave::sys::chdir; |
a99c2407f930
use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
53 |
6321 | 54 #endif |
55 | |
6123 | 56 #endif |