Skip to content

Zend/zend_types.h: move zend_result to separate header #10609

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Zend/Optimizer/zend_ssa.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "zend_optimizer.h"
#include "zend_cfg.h"
#include "zend_result.h"

typedef struct _zend_ssa_range {
zend_long min;
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#ifndef ZEND_ALLOC_H
#define ZEND_ALLOC_H

#include "zend_result.h"

#include <stdio.h>

#include "../TSRM/TSRM.h"
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_builtin_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#ifndef ZEND_BUILTIN_FUNCTIONS_H
#define ZEND_BUILTIN_FUNCTIONS_H

#include "zend_result.h"

zend_result zend_startup_builtin_functions(void);

BEGIN_EXTERN_C()
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#ifndef ZEND_EXCEPTIONS_H
#define ZEND_EXCEPTIONS_H

#include "zend_result.h"

BEGIN_EXTERN_C()

extern ZEND_API zend_class_entry *zend_ce_throwable;
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "zend_compile.h"
#include "zend_build.h"
#include "zend_result.h"

/*
The constants below are derived from ext/opcache/ZendAccelerator.h
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_highlight.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#ifndef ZEND_HIGHLIGHT_H
#define ZEND_HIGHLIGHT_H

#include "zend_result.h"

#define HL_COMMENT_COLOR "#FF8000" /* orange */
#define HL_DEFAULT_COLOR "#0000BB" /* blue */
#define HL_HTML_COLOR "#000000" /* black */
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_ini.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#ifndef ZEND_INI_H
#define ZEND_INI_H

#include "zend_result.h"

#define ZEND_INI_USER (1<<0)
#define ZEND_INI_PERDIR (1<<1)
#define ZEND_INI_SYSTEM (1<<2)
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_modules.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "zend.h"
#include "zend_compile.h"
#include "zend_build.h"
#include "zend_result.h"

#define INIT_FUNC_ARGS int type, int module_number
#define INIT_FUNC_ARGS_PASSTHRU type, module_number
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_multibyte.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#ifndef ZEND_MULTIBYTE_H
#define ZEND_MULTIBYTE_H

#include "zend_result.h"

typedef struct _zend_encoding zend_encoding;

typedef size_t (*zend_encoding_filter)(unsigned char **str, size_t *str_length, const unsigned char *buf, size_t length);
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_operators.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#ifndef ZEND_OPERATORS_H
#define ZEND_OPERATORS_H

#include "zend_result.h"

#include <errno.h>
#include <math.h>
#include <assert.h>
Expand Down
27 changes: 27 additions & 0 deletions Zend/zend_result.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
*/

#ifndef ZEND_RESULT_H
#define ZEND_RESULT_H

typedef enum {
SUCCESS = 0,
FAILURE = -1, /* this MUST stay a negative number, or it may affect functions! */
} ZEND_RESULT_CODE;

typedef ZEND_RESULT_CODE zend_result;

#endif /* ZEND_RESULT_H */
2 changes: 2 additions & 0 deletions Zend/zend_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#ifndef ZEND_STREAM_H
#define ZEND_STREAM_H

#include "zend_result.h"

#include <sys/types.h>
#include <sys/stat.h>

Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_system_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#ifndef ZEND_SYSTEM_ID_H
#define ZEND_SYSTEM_ID_H

#include "zend_result.h"

BEGIN_EXTERN_C()
/* True global; Write-only during MINIT/startup */
extern ZEND_API char zend_system_id[32];
Expand Down
9 changes: 2 additions & 7 deletions Zend/zend_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#include "zend_portability.h"
#include "zend_long.h"
#include "zend_result.h"

#include <stdbool.h>

#ifdef __SSE2__
Expand All @@ -50,13 +52,6 @@
typedef bool zend_bool;
typedef unsigned char zend_uchar;

typedef enum {
SUCCESS = 0,
FAILURE = -1, /* this MUST stay a negative number, or it may affect functions! */
} ZEND_RESULT_CODE;

typedef ZEND_RESULT_CODE zend_result;

#ifdef ZEND_ENABLE_ZVAL_LONG64
# ifdef ZEND_WIN32
# define ZEND_SIZE_MAX _UI64_MAX
Expand Down