PHP 8 compatibility
[m6w6/ext-psi] / src / builtin.c
index 9ed930c042eb4ca19b07165346cf5072c0c10f50..3ede389b189212119de25da3ee2f2365ee1f5b88 100644 (file)
@@ -43,6 +43,7 @@ static bool has_include(struct psi_cpp *cpp, struct psi_token *target, struct ps
 static bool has_include_next(struct psi_cpp *cpp, struct psi_token *target, struct psi_plist **args, struct psi_plist **res);
 static bool has_feature(struct psi_cpp *cpp, struct psi_token *target, struct psi_plist **args, struct psi_plist **res);
 static bool builtin_constant_p(struct psi_cpp *cpp, struct psi_token *target, struct psi_plist **args, struct psi_plist **res);
+static bool signed__(struct psi_cpp *cpp, struct psi_token *target, struct psi_plist **args, struct psi_plist **res);
 static bool BASE_FILE__(struct psi_cpp *cpp, struct psi_token *target, struct psi_plist **args, struct psi_plist **res);
 static bool COUNTER__(struct psi_cpp *cpp, struct psi_token *target, struct psi_plist **args, struct psi_plist **res);
 static bool DATE__(struct psi_cpp *cpp, struct psi_token *target, struct psi_plist **args, struct psi_plist **res);
@@ -109,6 +110,8 @@ PHP_MINIT_FUNCTION(psi_builtin)
        PSI_BUILTIN(has_feature, PSI_T_NAME);
        PSI_BUILTIN(builtin_constant_p, PSI_T_NAME);
 
+       PSI_BUILTIN(signed__, -1);
+
        PSI_BUILTIN(BASE_FILE__, -1);
        PSI_BUILTIN(COUNTER__, -1);
        PSI_BUILTIN(DATE__, -1);
@@ -224,6 +227,13 @@ static bool builtin_constant_p(struct psi_cpp *cpp, struct psi_token *target,
        ADD_TOKEN(tok_); \
 } while (0)
 
+static bool signed__(struct psi_cpp *cpp, struct psi_token *target,
+               struct psi_plist **args, struct psi_plist **res)
+{
+       ADD_TOKEN(NEW_TOKEN(PSI_T_SIGNED, "signed", 8));
+       return true;
+}
+
 static bool BASE_FILE__(struct psi_cpp *cpp, struct psi_token *target,
                struct psi_plist **args, struct psi_plist **res)
 {