home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / libg++-2.7.1-bin.lha / lib / g++-include / std / cinst.h < prev    next >
C/C++ Source or Header  |  1996-10-12  |  4KB  |  113 lines

  1. // Forward declarations of -*- C++ -*- complex number instantiations.
  2. // Copyright (C) 1994 Free Software Foundation
  3.  
  4. // This file is part of the GNU ANSI C++ Library.  This library is free
  5. // software; you can redistribute it and/or modify it under the
  6. // terms of the GNU General Public License as published by the
  7. // Free Software Foundation; either version 2, or (at your option)
  8. // any later version.
  9.  
  10. // This library is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14.  
  15. // You should have received a copy of the GNU General Public License
  16. // along with this library; see the file COPYING.  If not, write to the Free
  17. // Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18.  
  19. // As a special exception, if you link this library with files
  20. // compiled with a GNU compiler to produce an executable, this does not cause
  21. // the resulting executable to be covered by the GNU General Public License.
  22. // This exception does not however invalidate any other reasons why
  23. // the executable file might be covered by the GNU General Public License.
  24.  
  25. // Written by Jason Merrill based upon the specification in the 27 May 1994
  26. // C++ working paper, ANSI document X3J16/94-0098.
  27.  
  28. #ifndef __CINST__
  29. #define __CINST__
  30.  
  31. #ifndef _G_NO_EXTERN_TEMPLATES
  32. extern "C++" {
  33. extern template class complex<float>;
  34. extern template class complex<double>;
  35. extern template class complex<long double>;
  36.  
  37. #define __B(type) bool
  38. #define __C(type) complex<type>
  39. #define __F(type) type
  40. #define __I(type) int
  41. #define __IS(type) istream&
  42. #define __OS(type) ostream&
  43. #define __CR(type) complex<type>&
  44. #define __CCR(type) const complex<type>&
  45.  
  46. #define __D2(name,type,ret,arg1,arg2) ret(type) name (arg1(type), arg2(type));
  47.  
  48. #define __S1(name,type,ret,arg1) \
  49.   extern template ret(type) name (arg1(type));
  50. #define __S2(name,type,ret,arg1,arg2) \
  51.   extern template __D2 (name,type,ret,arg1,arg2)
  52.  
  53. #define __DO1(name,ret,arg1) \
  54.   __S1(name,float,ret,arg1) \
  55.   __S1(name,double,ret,arg1) \
  56.   __S1(name,long double,ret,arg1)
  57. #define __DO2(name,ret,arg1,arg2) \
  58.   __S2(name,float,ret,arg1,arg2) \
  59.   __S2(name,double,ret,arg1,arg2) \
  60.   __S2(name,long double,ret,arg1,arg2)
  61.  
  62. #define __DOCCC(name) __DO2(name,__C,__CCR,__CCR)
  63. #define __DOCCF(name) __DO2(name,__C,__CCR,__F)
  64. #define __DOCFC(name) __DO2(name,__C,__F,__CCR)
  65. #define __DOCFF(name) __DO2(name,__C,__F,__F)
  66. #define __DOBCC(name) __DO2(name,__B,__CCR,__CCR)
  67. #define __DOBCF(name) __DO2(name,__B,__CCR,__F)
  68. #define __DOBFC(name) __DO2(name,__B,__F,__CCR)
  69. #define __DOFC(name) __DO1(name,__F,__CCR)
  70. #define __DOCC(name) __DO1(name,__C,__CCR)
  71.  
  72. __DO2(operator+,__C,__CCR,__CCR)
  73. __DO2(operator+,__C,__CCR,__F)
  74. __DO2(operator+,__C,__F,__CCR)
  75. __DO2(operator-,__C,__CCR,__CCR)
  76. __DO2(operator-,__C,__CCR,__F)
  77. __DO2(operator-,__C,__F,__CCR)
  78. __DO2(operator*,__C,__CCR,__CCR)
  79. __DO2(operator*,__C,__CCR,__F)
  80. __DO2(operator*,__C,__F,__CCR)
  81. __DO2(operator/,__C,__CCR,__F)
  82. __DO1(operator+,__C,__CCR)
  83. __DO1(operator-,__C,__CCR)
  84. __DO2(operator==,__B,__CCR,__CCR)
  85. __DO2(operator==,__B,__CCR,__F)
  86. __DO2(operator==,__B,__F,__CCR)
  87. __DO2(operator!=,__B,__CCR,__CCR)
  88. __DO2(operator!=,__B,__CCR,__F)
  89. __DO2(operator!=,__B,__F,__CCR)
  90. __DO1(abs,__F,__CCR)
  91. __DO1(arg,__F,__CCR)
  92. __DO2(polar,__C,__F,__F)
  93. __DO1(conj,__C,__CCR)
  94. __DO1(norm,__F,__CCR)
  95.  
  96. #undef __DO1
  97. #undef __DO2
  98. #undef __S1
  99. #undef __S2
  100. #undef __D2
  101. #undef __B
  102. #undef __C
  103. #undef __F
  104. #undef __I
  105. #undef __IS
  106. #undef __OS
  107. #undef __CR
  108. #undef __CCR
  109. } // extern "C++"
  110. #endif
  111.  
  112. #endif
  113.