stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Black <>
Subject Re: [patch] exec utility windows port
Date Thu, 10 Aug 2006 20:30:30 GMT

Attached is a reworked version of the patch with the requested changes 
included.  Unfortunately, the change log has changed enough that a new 
one is required.  If it is decided that the windows file structure is to 
be altered (with regards to the location of object files), this patch 
will need to be altered slightly.

One that was asked was 'Why can't we use backslash as the escape 
character on Windows?'  My answer is that the character is used as a 
path separator, and it would be impossible to disambiguate the 
conflicting uses.  I use ^ as the escape character on windows, as that's 
the escape character used elsewhere in windows.

Another question that was asked was about the block I #if 0 ed out. 
This change was intentional.  The block in question is/was used to check 
compile only targets, but we don't have any of those at this time.  IF 
this check were to be kept, it would need platform specific logic to 
handle the differences in suffixes for object files between windows and 

--Andrew Black

	* util.h (rw_snprintf): Add macro hack to work around lack of snprintf 
definition on windows.
	* util.h (reference_name, output_name): Declare functions to generate 
the names for reference and output files respectively.
	* util.cpp (reference_name, output_name): Define above.
	* cmdopt.h (escape_code, default_path_sep, suffix_len): Declare 
platform specific constants related to the file system.
	* cmdopt.cpp (escape_code, default_path_sep, suffix_len): Define above, 
conditional on platform.
	* cmdopt.cpp: Alter #includes to include windows.h on windows in place 
of unistd.h.
	* cmdopt.cpp (rw_sleep, rw_signal): Define platform abstraction 
functions for sleep and signal/sigaction, conditional on platform.
	* cmdopt.cpp (eval_options): use use rw_sleep() in place of sleep(), 
rw_signal() in place of sigaction().
	* cmdopt.cpp (split_opt_string): use escape_code as escape character in 
place of '\'.
	* exec.h (exec_attrs): Alter structure for windows builds.
	* exec.cpp: Alter #includes to include windows.h and process.h on 
windows in place of unistd.h and sys/wait.h
	* exec.cpp (get_signame): Use rw_snprintf in place of snprintf.
	* exec.cpp (handle_alrm, wait_for_child, open_input, replace_file, 
exec_file): Compile (existing) versions only on non-windows platforms.
	* exec.cpp (open_input, exec_file): Alter (existing) version to use 
reference_name, output_name respectively.
	* exec.cpp (open_input, merge_argv, exec_file): Define new functions 
using windows native API, which will compile only on windows platforms.
	* output.cpp (check_example): Use reference_name to determine reference 
file location.
	* runall.cpp (S_IXUSR, S_IXGRP, S_IXOTH): Define if not defined for 
	* runall.cpp (check_target_ok): Disable (unused) logic for output only 
targets.  Alter compile check on windows systems to correctly locate 
.obj file.
	* runall.cpp (process_results): Handle windows result codes correctly.
	* runall.cpp (rw_basename): Use default_path_sep as separator for 
non-windows builds.

View raw message