#include <winsock.h>
#endif
-#if !defined(__GNUC__)
-# define __builtin_expect(form,value) (form)
-#else
-# if (__GNUC__ < 3)
-# define __builtin_expect(form,value) (form)
-# endif
-#endif
-
#ifdef GBC_BOEHM
static void finalize_queued();
}
if (nopt == 0 && !rest_flag && !key_flag) {
put_lineno();
- fprintf(out, "\tif (narg!=%d) FEwrong_num_arguments(MAKE_FIXNUM(%d));\n", nreq, function_code);
+ fprintf(out, "\tif (__builtin_expect(narg!=%d,0)) FEwrong_num_arguments(MAKE_FIXNUM(%d));\n", nreq, function_code);
} else {
simple_varargs = !rest_flag && !key_flag && ((nreq + nopt) < 32);
if (key_flag) {
rest_var, rest_var, ((nreq > 0) ? required[nreq-1] : "narg"),
nreq);
put_lineno();
- fprintf(out, "\tif (narg < %d", nreq);
+ fprintf(out, "\tif (__builtin_expect(narg < %d", nreq);
if (nopt > 0 && !rest_flag && !key_flag) {
fprintf(out, "|| narg > %d", nreq + nopt);
}
- fprintf(out, ") FEwrong_num_arguments(MAKE_FIXNUM(%d));\n", function_code);
+ fprintf(out, ",0)) FEwrong_num_arguments(MAKE_FIXNUM(%d));\n", function_code);
for (i = 0; i < nopt; i++) {
put_lineno();
fprintf(out, "\tif (narg > %d) {\n", nreq+i);
(unless (or local-entry-p (not (compiler-check-args)))
(incf *inline-blocks*)
(if (and use-narg (not varargs))
- (wt-nl "if(narg!=" nreq ") FEwrong_num_arguments_anonym();")
+ (wt-nl "if (__builtin_expect(narg!=" nreq ",0)) FEwrong_num_arguments_anonym();")
(when varargs
(when requireds
- (wt-nl "if(narg<" nreq ") FEwrong_num_arguments_anonym();"))
+ (wt-nl "if (__builtin_expect(narg<" nreq ",0)) FEwrong_num_arguments_anonym();"))
(unless (or rest keywords allow-other-keys)
- (wt-nl "if(narg>" (+ nreq nopt) ") FEwrong_num_arguments_anonym();"))))
+ (wt-nl "if (__builtin_expect(narg>" (+ nreq nopt) ",0)) FEwrong_num_arguments_anonym();"))))
(wt-nl "{"))
;; If the number of required arguments exceeds the number of variables we
#else
#define ECL_INLINE
#endif
+#if !defined(__GNUC__)
+# define __builtin_expect(form,value) (form)
+#else
+# if (__GNUC__ < 3)
+# define __builtin_expect(form,value) (form)
+# endif
+#endif
typedef void (*ecl_init_function_t)(cl_object block);
extern ECL_API void FEend_of_file(cl_object strm) /*__attribute__((noreturn))*/;
extern ECL_API void FEclosed_stream(cl_object strm) /*__attribute__ ((noreturn))*/;
extern ECL_API void FEwrong_type_argument(cl_object type, cl_object value) /*__attribute__((noreturn))*/;
-extern ECL_API void FEwrong_num_arguments(cl_object fun) /*__attribute__((noreturn))*/;
-extern ECL_API void FEwrong_num_arguments_anonym(void) /*__attribute__((noreturn))*/;
+extern ECL_API void FEwrong_num_arguments(cl_object fun) __attribute__((noreturn));
+extern ECL_API void FEwrong_num_arguments_anonym(void) __attribute__((noreturn));
extern ECL_API void FEunbound_variable(cl_object sym) /*__attribute__((noreturn))*/;
extern ECL_API void FEinvalid_macro_call(cl_object obj) /*__attribute__((noreturn))*/;
extern ECL_API void FEinvalid_variable(const char *s, cl_object obj) /*__attribute__((noreturn))*/;