home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / linux / backup / star-1.3.1.tar.gz / star-1.3.1.tar / star-1.3.1 / README.ppc < prev    next >
Text File  |  2000-05-28  |  2KB  |  63 lines

  1. If your system uses the SVr4 ABI (designed by Motorola), you will only
  2. be able to compile my library files lib/format.c and lib/getargs.c if your
  3. C-compiler supports the macro va_copy() or __va_copy() from stdarg.h.
  4.  
  5. Mach/Next STep/Apple Rhapsody on ppc use a 'void *' for the type va_list
  6. so you don't need to make changes on these systems.
  7.  
  8. Solaris/ppc (made in 1992) is the first UNIX implementation for the PPC.
  9. It includes the va_copy() macro that allows you to assign a C object of the
  10. type va_list in a system independent way.
  11.  
  12. Linux/ppc uses exactly the same construct as Solaris for the type va_list.
  13. You will only be able to compile lib/format.c and lib/getargs.c if your 
  14. C-compiler includes the macro va_copy() or __va_copy(). If this is not the
  15. case, you will need to upgrade your C-compiler first. GCC 2.8.0 and later
  16. includes this macro.
  17.  
  18. Here is what Solaris /usr/include/sys/varargs.h looks like:
  19.  
  20. /*
  21.  * va_copy is a Solaris extension to provide a portable way to perform
  22.  * a variable argument list ``bookmarking'' function.
  23.  */
  24. #if defined(__ppc)
  25. #define    va_copy(to, from)    ((to)[0] = (from)[0])
  26. #else
  27. #define    va_copy(to, from)    ((to) = (from))
  28. #endif
  29.  
  30. To be able to compile my lib/format.c and lib/getargs.c on a OS
  31. implementation that uses an array for va_list, you will need
  32. this va_copy() enhancement too.
  33.  
  34. The files mentioned above already compile on a PPC Apple Rhapsody system.
  35. But as mentioned before, Rhapsody uses a void * for va_list (maybe because
  36. Apple includes badly designed international printf code from BSD 4.4
  37. that requires va_list to be void * to work).
  38.  
  39. Notice:    lib/format.c allows a %r format that needs additional features
  40.     in stdarg.h. You need to know whether va_list is an array.
  41.     I hope that GCC will include some definitions in future versions
  42.     that allow to propagate va_list type objects from var args
  43.     in function calls.
  44.  
  45. GCC
  46. ===
  47.  
  48. If you are not using GCC 2.8.0, you can add the following definition 
  49. to va-ppc.h :
  50.  
  51. /usr/lib/gcc-lib/*-linux-gnulibc1/2.*/include/va-ppc.h
  52.  
  53. #define    va_copy(to, from)    ((to)[0] = (from)[0])
  54.  
  55. and to all other va-*.h files:
  56.  
  57. #define    va_copy(to, from)    ((to) = (from))
  58.  
  59. Important: Check before if you don't have a GCC that is already patched.
  60.  
  61. Joerg
  62.  
  63.