Skip to content

Commit 6335264

Browse files
authored
Fix header errors when parsed standalone (#14272)
This is annoying for multiple reasons: 1. LSPs can show many errors for these files. 2. LSP can stop parsing these files completely if there are too many errors, resulting in spotty LSP features.
1 parent 78f72cf commit 6335264

28 files changed

+68
-3
lines changed

Zend/zend_alloc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include <stdio.h>
2525

26+
#include "zend_types.h"
2627
#include "../TSRM/TSRM.h"
2728

2829
#ifndef ZEND_MM_ALIGNMENT

Zend/zend_attributes.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#ifndef ZEND_ATTRIBUTES_H
2121
#define ZEND_ATTRIBUTES_H
2222

23+
#include "zend_compile.h"
24+
2325
#define ZEND_ATTRIBUTE_TARGET_CLASS (1<<0)
2426
#define ZEND_ATTRIBUTE_TARGET_FUNCTION (1<<1)
2527
#define ZEND_ATTRIBUTE_TARGET_METHOD (1<<2)

Zend/zend_builtin_functions.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
#ifndef ZEND_BUILTIN_FUNCTIONS_H
2121
#define ZEND_BUILTIN_FUNCTIONS_H
2222

23+
#include "zend_types.h"
24+
25+
typedef struct _zval_struct zval;
26+
2327
zend_result zend_startup_builtin_functions(void);
2428

2529
BEGIN_EXTERN_C()

Zend/zend_closures.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#ifndef ZEND_CLOSURES_H
2121
#define ZEND_CLOSURES_H
2222

23+
#include "zend_types.h"
24+
2325
BEGIN_EXTERN_C()
2426

2527
/* This macro depends on zend_closure structure layout */

Zend/zend_enum.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#define ZEND_ENUM_H
2121

2222
#include "zend.h"
23-
#include "zend_types.h"
23+
#include "zend_API.h"
2424

2525
#include <stdint.h>
2626

Zend/zend_exceptions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#ifndef ZEND_EXCEPTIONS_H
2323
#define ZEND_EXCEPTIONS_H
2424

25+
#include "zend_types.h"
26+
2527
BEGIN_EXTERN_C()
2628

2729
extern ZEND_API zend_class_entry *zend_ce_throwable;

Zend/zend_float.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#ifndef ZEND_FLOAT_H
2020
#define ZEND_FLOAT_H
2121

22+
#include "zend_portability.h"
23+
2224
BEGIN_EXTERN_C()
2325

2426
/*

Zend/zend_generators.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
#include <stdint.h>
2424

25+
#include "zend_compile.h"
26+
2527
BEGIN_EXTERN_C()
2628

2729
extern ZEND_API zend_class_entry *zend_ce_generator;

Zend/zend_globals_macros.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#ifndef ZEND_GLOBALS_MACROS_H
2121
#define ZEND_GLOBALS_MACROS_H
2222

23+
#include "zend_portability.h"
24+
2325
typedef struct _zend_compiler_globals zend_compiler_globals;
2426
typedef struct _zend_executor_globals zend_executor_globals;
2527
typedef struct _zend_php_scanner_globals zend_php_scanner_globals;

Zend/zend_highlight.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#ifndef ZEND_HIGHLIGHT_H
2121
#define ZEND_HIGHLIGHT_H
2222

23+
#include "zend_types.h"
24+
2325
#define HL_COMMENT_COLOR "#FF8000" /* orange */
2426
#define HL_DEFAULT_COLOR "#0000BB" /* blue */
2527
#define HL_HTML_COLOR "#000000" /* black */

0 commit comments

Comments
 (0)