home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / GCC / GERLIB_DEV08B.LHA / gerlib / libg++ / AMIGA_README.txt next >
Encoding:
Text File  |  1993-12-12  |  3.8 KB  |  114 lines

  1. Tue Oct 26 23:28:50 1993 GM:
  2.  
  3. libg++ v2.4 for gerlib-package (amiga)
  4. --------------------------------------
  5.  
  6. Here is a minimal implemention of gnu's libg++-2.4.
  7.  
  8. Some (minor) changes were necessary to compile all we need without
  9. too much overhead. Not all files of the original distribution are
  10. provided, only the ones which were necessary or easily to compile.
  11.  
  12. Some notes on the implemantation:
  13.  
  14. Unix uses an int to store the "file-descriptor" returned by open(),
  15. close etc. Predefined ints are 0 for stdin, 1 for stdout and 2 for
  16. stderr.
  17.  
  18. As I did'nt want to write an overlay that converts the ints returned
  19. by open() I changed the libraray and the functions to store the
  20. BPTR from our AmigaDos-Open(). So no extra overhead layer is created.
  21.  
  22. The int values 0/1/2, however, are supported for compatiliby reasons
  23. in the functions open and close. (You won't need them, tough)
  24.  
  25. Some things that are not supported by this implemementation of
  26. libg++: (look at the ger_changes-File for exact diffs (sorry, german))
  27.  
  28.     - procbuf (A procbuf can read from or write to a Unix process)
  29.     - class stdiobuf (yet)
  30.  
  31. In the src/-directory some changes had to be done, look at the
  32. provided ger_changes-file. Sorry, it is in german...
  33.  
  34. Not supported is : Curses
  35.                    the provided malloc
  36.                    DLLs
  37.  
  38. If you want to compile unix-prgs, please use the gcc-Package of m.wild!
  39.  
  40. Functions like fopen/fclose/printf/sprintf etc. are supported through
  41. the iostreams/stdio-directory. To use them you have to use
  42.  
  43.     #include <stdio.h>
  44.  
  45. . But be careful, stdio.h redefines sprintf and printf to sprintf_gcc
  46. and printf_gcc, so if you want to use sprintf and printf from amiga.lib,
  47. #define sprintf and printf to something different BEFORE you include
  48. stdio.h, e.g.:
  49.  
  50. #define sprintf _sprintf
  51. #define printf _printf
  52.  
  53. #include <stdio.h>
  54.  
  55. #undef printf
  56. #undef sprintf
  57.  
  58. Now you can use (s)printf (from amiga.lib) and (s)printf_gcc (from
  59. iostreams-package). This difference is important if you are using
  60. e.g. floating point numbers, only (s)printf_gcc is able to handle them!
  61.  
  62. If you use c++-cout/cerr, use printf_gcc to get syncronized output!
  63.  
  64. Normally there is no need to use (s)printf of amiga.lib if you are
  65. using the iostream-Package. (s)printf of iostream-Package is MUCH
  66. better than the one in amiga.lib ;-)
  67.  
  68. stdio.h also defines stdin and stdout, you can't use them as BPTRs
  69. any more. You can use Input() and Output() for them instead (stdin
  70. is nomally defined as Input() and stdout=Output()).
  71.  
  72. If you want to compile programs that require standard argc and argv, or,
  73. are not amiga-Programs (that means open icon.library, commodities.library,
  74. mathtrans.library, mathieeedoubtrans.library and mathieeedoubbas.library)
  75. you can use the include-file "use_standard_argc_argv.h".
  76. This include-file has to be included in front of all the other include-files.
  77.  
  78. So a minimal program "minimal.cc" that uses cin/cout looks like:
  79. (examples/test/startup/minimal.cc)
  80.  
  81. #define NEED_STDOUT
  82. #include <use_standard_argc_argv.h>
  83. #include <iostream.h>
  84.  
  85. int main(int argc, char *argv[])
  86. {
  87.     cout << "Hello, World, ";
  88.  
  89.     if(argv[0])
  90.         cout << "our name is " << argv[0];
  91.     else
  92.         cout <<"nice that you started me from workbench";
  93.  
  94.     cout << ", we have " << argc << " arguments !" << endl;
  95.  
  96.     return 0;
  97. }
  98.  
  99. compile with:
  100.  
  101. gccv minimal.cc -lgpp -lger -lamiga
  102.  
  103. If the program needs a standard window (even if startet from workbench),
  104. define NEED_STDOUT, and a standard window is opened. The user can change
  105. the Window specifications via a tooltype-entry "WINDOW=...". All other
  106. tooltype options will get options as the would have been entered as options
  107. behind the command in the shell.
  108.  
  109. If the program is started from WB, the name of the program will be ZERO,
  110. so be sure you check the name. If you access argv[1], and no option is
  111. entered, you will get an enforcer-hit.
  112.  
  113. Look for the examples in examples/test/startup to get further informations.
  114.