Skip to content

Commit 33b360b

Browse files
committed
Zend/zend.h: move zend_error*() prototypes to zend_error.h
1 parent 1250ca5 commit 33b360b

File tree

6 files changed

+46
-15
lines changed

6 files changed

+46
-15
lines changed

Zend/zend.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525
#define ZEND_ENGINE_3
2626

27+
#include "zend_error.h" // TODO remove
2728
#include "zend_map_ptr.h" // for ZEND_MAP_PTR_DEF()
28-
#include "zend_errors.h" // for E_* (as zend_error_noreturn() parameter)
2929
#include "zend_portability.h" // for BEGIN_EXTERN_C
3030
#include "zend_result.h"
3131
#include "zend_signal.h" // for ZEND_SIGNAL_[UN]BLOCK_INTERRUPTIONS()
@@ -343,16 +343,6 @@ extern ZEND_API zend_string *(*zend_resolve_path)(zend_string *filename);
343343
extern ZEND_API zend_result (*zend_post_startup_cb)(void);
344344
extern ZEND_API void (*zend_post_shutdown_cb)(void);
345345

346-
ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
347-
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
348-
/* For custom format specifiers like H */
349-
ZEND_API ZEND_COLD void zend_error_unchecked(int type, const char *format, ...);
350-
/* If filename is NULL the default filename is used. */
351-
ZEND_API ZEND_COLD void zend_error_at(int type, zend_string *filename, uint32_t lineno, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 4, 5);
352-
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_at_noreturn(int type, zend_string *filename, uint32_t lineno, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 4, 5);
353-
ZEND_API ZEND_COLD void zend_error_zstr(int type, zend_string *message);
354-
ZEND_API ZEND_COLD void zend_error_zstr_at(int type, zend_string *filename, uint32_t lineno, zend_string *message);
355-
356346
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
357347
ZEND_API ZEND_COLD void zend_type_error(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2);
358348
ZEND_API ZEND_COLD void zend_argument_count_error(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2);

Zend/zend_arena.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#include "zend_alloc.h"
2323
#include "zend_multiply.h" // for zend_safe_address()
24-
#include "zend.h" // for zend_error()
24+
#include "zend_error.h"
2525

2626
#include <stddef.h> // for size_t
2727

Zend/zend_error.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
+----------------------------------------------------------------------+
3+
| Zend Engine |
4+
+----------------------------------------------------------------------+
5+
| Copyright (c) Zend Technologies Ltd. (http://www.zend.com) |
6+
+----------------------------------------------------------------------+
7+
| This source file is subject to version 2.00 of the Zend license, |
8+
| that is bundled with this package in the file LICENSE, and is |
9+
| available through the world-wide-web at the following url: |
10+
| http://www.zend.com/license/2_00.txt. |
11+
| If you did not receive a copy of the Zend license and are unable to |
12+
| obtain it through the world-wide-web, please send a note to |
13+
| license@zend.com so we can mail you a copy immediately. |
14+
+----------------------------------------------------------------------+
15+
*/
16+
17+
#ifndef ZEND_ERROR_H
18+
#define ZEND_ERROR_H
19+
20+
#include "zend_errors.h" // for E_* (as zend_error_noreturn() parameter)
21+
#include "zend_portability.h" // for BEGIN_EXTERN_C
22+
23+
#include <stdint.h>
24+
25+
typedef struct _zend_string zend_string;
26+
27+
BEGIN_EXTERN_C()
28+
29+
ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
30+
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
31+
/* For custom format specifiers like H */
32+
ZEND_API ZEND_COLD void zend_error_unchecked(int type, const char *format, ...);
33+
/* If filename is NULL the default filename is used. */
34+
ZEND_API ZEND_COLD void zend_error_at(int type, zend_string *filename, uint32_t lineno, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 4, 5);
35+
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_at_noreturn(int type, zend_string *filename, uint32_t lineno, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 4, 5);
36+
ZEND_API ZEND_COLD void zend_error_zstr(int type, zend_string *message);
37+
ZEND_API ZEND_COLD void zend_error_zstr_at(int type, zend_string *filename, uint32_t lineno, zend_string *message);
38+
39+
END_EXTERN_C()
40+
41+
#endif /* ZEND_H */

Zend/zend_gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
#include "zend_globals.h" // for struct _zend_executor_globals
7474
#include "zend_globals_macros.h" // for EG()
7575
#include "zend_objects.h" // for zend_objects_destroy_object()
76-
#include "zend.h" // for zend_error()
76+
#include "zend_error.h"
7777

7878
#ifndef GC_BENCH
7979
# define GC_BENCH 0

Zend/zend_multiply.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
#ifndef ZEND_MULTIPLY_H
2121
#define ZEND_MULTIPLY_H
2222

23+
#include "zend_error.h"
2324
#include "zend_long.h"
2425
#include "zend_portability.h"
25-
#include "zend.h"
2626

2727
#include <stdbool.h>
2828

Zend/zend_strtod.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
#include "zend_strtod.h"
190190
#include "zend_strtod_int.h"
191191
#include "zend_types.h" // for ZEND_TLS
192-
#include "zend.h" // for zend_error_noreturn()
192+
#include "zend_error.h"
193193

194194
#ifndef Long
195195
#define Long int32_t

0 commit comments

Comments
 (0)