instmac.m4 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* $XConsortium: instmac.m4 /main/3 1996/08/13 10:09:17 mgreess $ */
  2. #ifdef SP_NAMESPACE
  3. namespace SP_NAMESPACE {
  4. #endif
  5. dnl Copyright (c) 1994 James Clark
  6. dnl See the file COPYING for copying permission.
  7. dnl M4 macros for template instantiation.
  8. define(`__undefine', defn(`undefine'))dnl
  9. define(`__define', defn(`define'))dnl
  10. define(`__changequote', defn(`changequote'))dnl
  11. define(`__include', defn(`include'))dnl
  12. define(`__ifdef', defn(`ifdef'))dnl
  13. define(`__divert', defn(`divert'))dnl
  14. define(`__dnl', defn(`dnl'))dnl
  15. define(`__incr', defn(`incr'))dnl
  16. define(`__index', 0)dnl
  17. define(`__concat', $1$2)dnl
  18. define(`__instantiate',`#if defined(__DECCXX)
  19. #pragma define_template $1
  20. #elif defined(AIXV3)
  21. #pragma define($1)
  22. #elif defined(SP_ANSI_CLASS_INST)
  23. template class $1;
  24. #else
  25. typedef $1 __concat(Dummy_,__index);
  26. #endif
  27. __define(`__index',__incr(__index))__dnl')dnl
  28. define(`__func_index', 0)dnl
  29. define(`__instantiate_func3',
  30. `#ifdef __GNUG__
  31. template void $1($2, $3, $4);
  32. #else
  33. static
  34. void __concat(func_,__func_index) ($2 arg1, $3 arg2, $4 arg3) {
  35. (void)$1(arg1, arg2, arg3);
  36. }
  37. #endif
  38. __define(`__func_index',__incr(__func_index))__dnl')dnl
  39. dnl we want __p to be expanded even inside comments
  40. changecom()__dnl
  41. __undefine(`changecom')__dnl
  42. __undefine(`changequote')__dnl
  43. __undefine(`decr')__dnl
  44. __undefine(`define')__dnl
  45. __undefine(`defn')__dnl
  46. __undefine(`divert')__dnl
  47. __undefine(`divnum')__dnl
  48. __undefine(`dnl')__dnl
  49. __undefine(`dumpdef')__dnl
  50. __undefine(`errprint')__dnl
  51. __undefine(`eval')__dnl
  52. __undefine(`ifdef')__dnl
  53. __undefine(`ifelse')__dnl
  54. __undefine(`include')__dnl
  55. __undefine(`incr')__dnl
  56. __undefine(`index')__dnl
  57. __undefine(`len')__dnl
  58. __undefine(`m4exit')__dnl
  59. __undefine(`m4wrap')__dnl
  60. __undefine(`maketemp')__dnl
  61. __undefine(`popdef')__dnl
  62. __undefine(`pushdef')__dnl
  63. __undefine(`shift')__dnl
  64. __undefine(`sinclude')__dnl
  65. __undefine(`substr')__dnl
  66. __undefine(`syscmd')__dnl
  67. __undefine(`sysval')__dnl
  68. __undefine(`traceoff')__dnl
  69. __undefine(`traceon')__dnl
  70. __undefine(`translit')__dnl
  71. __undefine(`undefine')__dnl
  72. __undefine(`undivert')__dnl
  73. __undefine(`unix')__dnl
  74. __dnl __changequote(,)__dnl disable quoting
  75. #ifdef SP_NAMESPACE
  76. }
  77. #endif