From bff4fc78a4ba6b116a933e972f7350229f2d731c Mon Sep 17 00:00:00 2001 From: johnvg Date: Fri, 7 May 2004 16:01:20 +0000 Subject: convert hfs file name to unix file name for freopen on MacOSX/MachO git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1497 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d --- backendC/CleanCompilerSources/cocl.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'backendC') diff --git a/backendC/CleanCompilerSources/cocl.c b/backendC/CleanCompilerSources/cocl.c index 319e40a..da77da2 100644 --- a/backendC/CleanCompilerSources/cocl.c +++ b/backendC/CleanCompilerSources/cocl.c @@ -96,6 +96,23 @@ int use_clean_system_files; */ #endif +#if defined (_MAC_) && defined (GNU_C) +extern char *convert_file_name (char *file_name,char *buffer); + +static FILE *freopen_with_file_name_conversion (char *file_name,char *mode,FILE *file_p) +{ + char buffer[512+1]; + + file_name=convert_file_name (file_name,buffer); + if (file_name==NULL) + return NULL; + + return freopen (file_name,mode,file_p); +} + +# define freopen freopen_with_file_name_conversion +#endif + #ifdef CLEAN2 Bool ParseCommandArgs (int argc, char **argv, char **file_name_p, char **output_file_name_p) #else -- cgit v1.2.3