diff options
-rw-r--r-- | cg.c | 42 | ||||
-rw-r--r-- | cginput.c | 2 | ||||
-rw-r--r-- | cgpas.c | 6 | ||||
-rw-r--r-- | cgport.h | 8 | ||||
-rw-r--r-- | cgpwas.c | 4 |
5 files changed, 38 insertions, 24 deletions
@@ -396,25 +396,37 @@ char *this_module_name; # define FOLDER_SEPARATOR ':' #endif -#ifdef PROJECT_BUILDER +#if defined (POWER) && defined (GNU_C) static FILE *fopen_with_file_name_conversion (char *file_name,char *mode) { - static char file_name_s[257]; - char *p; + FSSpec fs_spec; + FSRef fs_ref; + CFURLRef CFURL_ref; + char buffer[512+1]; + int string_size; + Boolean r; + OSErr e; + + buffer[0]=strlen (file_name); + strcpy (&buffer[1],file_name); + + e=FSMakeFSSpec (0/*vRefNum*/,0/*dirID*/,buffer,&fs_spec); + if (e!=noErr) + return NULL; + + e=FSpMakeFSRef (&fs_spec,&fs_ref); + if (e!=noErr) + return NULL; + + CFURL_ref=CFURLCreateFromFSRef (NULL,&fs_ref); - for (p=file_name; *p!='\0' && *p!=':'; ++p) - ; + string_size=512; + r=CFURLGetFileSystemRepresentation (CFURL_ref,1,buffer,string_size); - if (*p==':'){ - strcpy (file_name_s,"/Volumes/"); - strcat (file_name_s,file_name); - - for (p=file_name_s; *p!='\0'; ++p) - if (*p==':') - *p='/'; - - file_name=file_name_s; - } + if (!r) + return NULL; + + file_name=buffer; return fopen (file_name,mode); } @@ -410,7 +410,7 @@ static int parse_string_character (char *c_p) switch (last_char){ case 'b': *c_p='\b'; break; case 'f': *c_p='\f'; break; -#if (defined (M68000) && !defined (SUN)) || defined (__MWERKS__) || defined (__MRC__) +#if (defined (M68000) && !defined (SUN)) || defined (__MWERKS__) || defined (__MRC__) || defined (POWER) case 'n': *c_p='\xd'; break; case 'r': *c_p='\xa'; break; #else @@ -17,7 +17,7 @@ #if defined (LINUX_ELF) # define ELF # include <elf.h> -#elif defined (PROJECT_BUILDER) || defined (MACH_O) +#elif defined (MACH_O) || defined (GNU_C) # define G_MACH_O # define G_MACH_O_SCATTERED # include </usr/include/mach-o/loader.h> @@ -27,6 +27,10 @@ # define XCOFF #endif +#ifdef GNU_C +# include <ppc_intrinsics.h> +#endif + #define for_l(v,l,n) for(v=(l);v!=NULL;v=v->n) #undef USE_DCBZ @@ -1,13 +1,7 @@ #define FINALIZERS -#undef PROJECT_BUILDER - -#ifdef PROJECT_BUILDER -# define GNU_C -#endif - -#if defined (__MWERKS__) || defined (__MRC__) || defined (PROJECT_BUILDER) +#if defined (__MWERKS__) || defined (__MRC__) # define POWER # ifdef __cplusplus # include "cgrenameglobals.h" @@ -48,6 +48,10 @@ #include "cgptoc.h" #include "cgpwas.h" +#ifdef GNU_C +# include <ppc_intrinsics.h> +#endif + #define FP_REVERSE_SUB_DIV_OPERANDS 1 #define for_l(v,l,n) for(v=(l);v!=NULL;v=v->n) |