aboutsummaryrefslogtreecommitdiff
path: root/backendC
diff options
context:
space:
mode:
authorjohnvg2004-05-07 16:01:20 +0000
committerjohnvg2004-05-07 16:01:20 +0000
commitbff4fc78a4ba6b116a933e972f7350229f2d731c (patch)
treee8401dcb2857fe29a24fb427c4b460c8f47cf8ef /backendC
parentWhen creating new functions for case expression, don't pass the variable (diff)
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
Diffstat (limited to 'backendC')
-rw-r--r--backendC/CleanCompilerSources/cocl.c17
1 files changed, 17 insertions, 0 deletions
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