diff options
author | johnvg | 2004-04-26 12:52:40 +0000 |
---|---|---|
committer | johnvg | 2004-04-26 12:52:40 +0000 |
commit | 1b61d1ef995081619403fe2983d139b9a8267628 (patch) | |
tree | dfe517ae0d7aff321535aadb40a473bf4543b191 /backendC | |
parent | added ')' to #ifdef to fix syntax error (diff) |
convert file names for MachO
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1491 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'backendC')
-rw-r--r-- | backendC/CleanCompilerSources/mac_io.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/backendC/CleanCompilerSources/mac_io.c b/backendC/CleanCompilerSources/mac_io.c index f153e0e..c418688 100644 --- a/backendC/CleanCompilerSources/mac_io.c +++ b/backendC/CleanCompilerSources/mac_io.c @@ -804,6 +804,32 @@ extern char *clean_abc_path; /* imported from clm.c */ } #endif +<<<<<<< mac_io.c +#if defined (GNU_C) +static FILE *fopen_with_file_name_conversion (char *file_name,char *mode) +{ + CFURLRef hfs_url; + CFStringRef hfs_string, posix_string; + char buffer[512+1]; + + hfs_string = CFStringCreateWithCString (NULL/*kCFAllocatorDefault*/,file_name,kCFStringEncodingMacRoman); + hfs_url = CFURLCreateWithFileSystemPath (NULL/*kCFAllocatorDefault*/,hfs_string,kCFURLHFSPathStyle,/*isDirectory*/false); + CFRelease (hfs_string); + posix_string = CFURLCopyFileSystemPath (hfs_url,kCFURLPOSIXPathStyle); + CFRelease (hfs_url); + if (! CFStringGetCString (posix_string,buffer,512,kCFStringEncodingMacRoman)){ + CFRelease (posix_string); + return NULL; + } + file_name=buffer; + + return fopen (file_name,mode); +} + +# define fopen fopen_with_file_name_conversion +#endif + +======= #if defined (GNU_C) static FILE *fopen_with_file_name_conversion (char *file_name,char *mode) { @@ -842,6 +868,7 @@ static FILE *fopen_with_file_name_conversion (char *file_name,char *mode) # define fopen fopen_with_file_name_conversion #endif +>>>>>>> 1.4 #if WRITE_DCL_MODIFICATION_TIME File FOpenWithFileTime (char *file_name,FileKind kind, char *mode,FileTime *file_time_p) { |