@@ -182,21 +182,45 @@ void ansi_c_internal_additions(std::string &code)
182182 " \n " ;
183183
184184 // GCC junk stuff, also for CLANG and ARM
185- if (config.ansi_c .mode ==configt::ansi_ct::flavourt::GCC ||
186- config.ansi_c .mode ==configt::ansi_ct::flavourt::APPLE ||
187- config.ansi_c .mode ==configt::ansi_ct::flavourt::ARM)
185+ if (
186+ config.ansi_c .mode == configt::ansi_ct::flavourt::GCC ||
187+ config.ansi_c .mode == configt::ansi_ct::flavourt::CLANG ||
188+ config.ansi_c .mode == configt::ansi_ct::flavourt::ARM)
188189 {
189190 code+=gcc_builtin_headers_types;
190191
191192 // there are many more, e.g., look at
192193 // https://developer.apple.com/library/mac/#documentation/developertools/gcc-4.0.1/gcc/Target-Builtins.html
193194
194- if (config.ansi_c .arch ==" i386" ||
195- config.ansi_c .arch ==" x86_64" ||
196- config.ansi_c .arch ==" x32" )
195+ if (
196+ config.ansi_c .arch == " i386" || config.ansi_c .arch == " x86_64" ||
197+ config.ansi_c .arch == " x32" || config.ansi_c .arch == " powerpc" ||
198+ config.ansi_c .arch == " ppc64" || config.ansi_c .arch == " ppc64le" ||
199+ config.ansi_c .arch == " ia64" )
197200 {
198- if (config.ansi_c .mode ==configt::ansi_ct::flavourt::APPLE)
199- code+=" typedef double __float128;\n " ; // clang doesn't do __float128
201+ // https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html
202+ // For clang, __float128 is a keyword.
203+ // For gcc, this is a typedef and not a keyword.
204+ if (config.ansi_c .mode != configt::ansi_ct::flavourt::CLANG)
205+ code += " typedef __CPROVER_Float128 __float128;\n " ;
206+ }
207+ else if (config.ansi_c .arch == " hppa" )
208+ {
209+ // https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html
210+ // For clang, __float128 is a keyword.
211+ // For gcc, this is a typedef and not a keyword.
212+ if (config.ansi_c .mode != configt::ansi_ct::flavourt::CLANG)
213+ code+=" typedef long double __float128;\n " ;
214+ }
215+
216+ if (
217+ config.ansi_c .arch == " i386" || config.ansi_c .arch == " x86_64" ||
218+ config.ansi_c .arch == " x32" || config.ansi_c .arch == " ia64" )
219+ {
220+ // clang doesn't do __float80
221+ // Note that __float80 is a typedef, and not a keyword.
222+ if (config.ansi_c .mode != configt::ansi_ct::flavourt::CLANG)
223+ code += " typedef __CPROVER_Float64x __float80;\n " ;
200224 }
201225
202226 // On 64-bit systems, gcc has typedefs
0 commit comments