#include <pike_types.h>
#include <interpret.h>
#include <module_support.h>
-#include <error.h>
#include <array.h>
#include <backend.h>
#include <stralloc.h>
#include <operators.h>
#include <version.h>
+#if (PIKE_MAJOR_VERSION == 7 && PIKE_MINOR_VERSION == 1 && PIKE_BUILD_VERSION >= 12) || PIKE_MAJOR_VERSION > 7 || (PIKE_MAJOR_VERSION == 7 && PIKE_MINOR_VERSION > 1)
+# include "pike_error.h"
+#else
+# include "error.h"
+# ifndef Pike_error
+# define Pike_error error
+# endif
+#endif
+
#ifndef ZTS
/* Need thread safety */
#error You need to compile PHP with threads.
php_caudium_request *_request;
THIS = malloc(sizeof(php_caudium_request));
if(THIS == NULL)
- error("Out of memory.");
+ Pike_error("Out of memory.");
// if(current_thread == th_self())
- // error("PHP4.Interpreter->run: Tried to run a PHP-script from a PHP "
+ // Pike_error("PHP4.Interpreter->run: Tried to run a PHP-script from a PHP "
// "callback!");
get_all_args("PHP4.Interpreter->run", args, "%S%m%O%*", &script,
&request_data, &my_fd_obj, &done_callback);
if(done_callback->type != PIKE_T_FUNCTION)
- error("PHP4.Interpreter->run: Bad argument 4, expected function.\n");
+ Pike_error("PHP4.Interpreter->run: Bad argument 4, expected function.\n");
add_ref(request_data);
add_ref(my_fd_obj);
add_ref(script);