Skip to content

Fix header errors when parsed standalone #14272

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
May 20, 2024
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/zend_alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <stdio.h>

#include "zend_types.h"
#include "../TSRM/TSRM.h"

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

#include "zend_compile.h"

#define ZEND_ATTRIBUTE_TARGET_CLASS (1<<0)
#define ZEND_ATTRIBUTE_TARGET_FUNCTION (1<<1)
#define ZEND_ATTRIBUTE_TARGET_METHOD (1<<2)
Expand Down
4 changes: 4 additions & 0 deletions Zend/zend_builtin_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
#ifndef ZEND_BUILTIN_FUNCTIONS_H
#define ZEND_BUILTIN_FUNCTIONS_H

#include "zend_types.h"

typedef struct _zval_struct zval;

zend_result zend_startup_builtin_functions(void);

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

#include "zend_types.h"

BEGIN_EXTERN_C()

/* This macro depends on zend_closure structure layout */
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#define ZEND_ENUM_H

#include "zend.h"
#include "zend_types.h"
#include "zend_API.h"

#include <stdint.h>

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_types.h"

BEGIN_EXTERN_C()

extern ZEND_API zend_class_entry *zend_ce_throwable;
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_float.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#ifndef ZEND_FLOAT_H
#define ZEND_FLOAT_H

#include "zend_portability.h"

BEGIN_EXTERN_C()

/*
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_generators.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

#include <stdint.h>

#include "zend_compile.h"

BEGIN_EXTERN_C()

extern ZEND_API zend_class_entry *zend_ce_generator;
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_globals_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#ifndef ZEND_GLOBALS_MACROS_H
#define ZEND_GLOBALS_MACROS_H

#include "zend_portability.h"

typedef struct _zend_compiler_globals zend_compiler_globals;
typedef struct _zend_executor_globals zend_executor_globals;
typedef struct _zend_php_scanner_globals zend_php_scanner_globals;
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_types.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_modules.h"

#define ZEND_INI_USER (1<<0)
#define ZEND_INI_PERDIR (1<<1)
#define ZEND_INI_SYSTEM (1<<2)
Expand Down
4 changes: 4 additions & 0 deletions Zend/zend_ini_scanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
#ifndef _ZEND_INI_SCANNER_H
#define _ZEND_INI_SCANNER_H

#include "zend_types.h"

typedef struct _zend_file_handle zend_file_handle;

/* Scanner modes */
#define ZEND_INI_SCANNER_NORMAL 0 /* Normal mode. [DEFAULT] */
#define ZEND_INI_SCANNER_RAW 1 /* Raw mode. Option values are not parsed */
Expand Down
7 changes: 7 additions & 0 deletions Zend/zend_iterators.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
+----------------------------------------------------------------------+
*/

#ifndef ZEND_ITERATORS_H
#define ZEND_ITERATORS_H

#include "zend_types.h"

/* These iterators were designed to operate within the foreach()
* structures provided by the engine, but could be extended for use
* with other iterative engine opcodes.
Expand Down Expand Up @@ -89,3 +94,5 @@ ZEND_API void zend_iterator_dtor(zend_object_iterator *iter);

ZEND_API void zend_register_iterator_wrapper(void);
END_EXTERN_C()

#endif /* ZEND_ITERATORS_H */
2 changes: 2 additions & 0 deletions Zend/zend_language_scanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#ifndef ZEND_SCANNER_H
#define ZEND_SCANNER_H

#include "zend_globals.h"

typedef struct _zend_lex_state {
unsigned int yy_leng;
unsigned char *yy_start;
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_llist.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#ifndef ZEND_LLIST_H
#define ZEND_LLIST_H

#include "zend_portability.h"

typedef struct _zend_llist_element {
struct _zend_llist_element *next;
struct _zend_llist_element *prev;
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_map_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include "zend_portability.h"

typedef struct _zend_string zend_string;

#define ZEND_MAP_PTR_KIND_PTR 0
#define ZEND_MAP_PTR_KIND_PTR_OR_OFFSET 1

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_types.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_object_handlers.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

#include <stdint.h>

#include "zend_types.h"

struct _zend_property_info;

#define ZEND_WRONG_PROPERTY_INFO \
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_ptr_stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#ifndef ZEND_PTR_STACK_H
#define ZEND_PTR_STACK_H

#include "zend_alloc.h"

typedef struct _zend_ptr_stack {
int top, max;
void **elements;
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

#include <signal.h>

#include "zend_portability.h"

#ifndef NSIG
#define NSIG 65
#endif
Expand Down
4 changes: 4 additions & 0 deletions Zend/zend_smart_str_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
#ifndef ZEND_SMART_STR_PUBLIC_H
#define ZEND_SMART_STR_PUBLIC_H

#include <stddef.h>

typedef struct _zend_string zend_string;

typedef struct {
/** See smart_str_extract() */
zend_string *s;
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_sort.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#ifndef ZEND_SORT_H
#define ZEND_SORT_H

#include "zend_types.h"

BEGIN_EXTERN_C()
ZEND_API void zend_sort(void *base, size_t nmemb, size_t siz, compare_func_t cmp, swap_func_t swp);
ZEND_API void zend_insert_sort(void *base, size_t nmemb, size_t siz, compare_func_t cmp, swap_func_t swp);
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#ifndef ZEND_STACK_H
#define ZEND_STACK_H

#include "zend_portability.h"

typedef struct _zend_stack {
int size, top, max;
void *elements;
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include <sys/types.h>
#include <sys/stat.h>

#include "zend_types.h"

/* Lightweight stream implementation for the ZE scanners.
* These functions are private to the engine.
* */
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_system_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ZEND_API char zend_system_id[32];
static PHP_MD5_CTX context;
static int finalized = 0;

ZEND_API ZEND_RESULT_CODE zend_add_system_entropy(const char *module_name, const char *hook_name, const void *data, size_t size)
ZEND_API zend_result zend_add_system_entropy(const char *module_name, const char *hook_name, const void *data, size_t size)
{
if (finalized == 0) {
PHP_MD5Update(&context, module_name, strlen(module_name));
Expand Down
4 changes: 3 additions & 1 deletion Zend/zend_system_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
#ifndef ZEND_SYSTEM_ID_H
#define ZEND_SYSTEM_ID_H

#include "zend_types.h"

BEGIN_EXTERN_C()
/* True global; Write-only during MINIT/startup */
extern ZEND_API char zend_system_id[32];

ZEND_API ZEND_RESULT_CODE zend_add_system_entropy(const char *module_name, const char *hook_name, const void *data, size_t size);
ZEND_API zend_result zend_add_system_entropy(const char *module_name, const char *hook_name, const void *data, size_t size);
END_EXTERN_C()

void zend_startup_system_id(void);
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_virtual_cwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
#include <errno.h>
#endif

#include "zend_stream.h"

#ifdef ZEND_WIN32
#include "win32/readdir.h"
#include <sys/utime.h>
Expand Down
5 changes: 5 additions & 0 deletions Zend/zend_vm.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
#ifndef ZEND_VM_H
#define ZEND_VM_H

#include "zend_portability.h"

typedef struct _zend_op zend_op;
typedef struct _zend_execute_data zend_execute_data;

BEGIN_EXTERN_C()

ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* opcode);
Expand Down
Loading