mirror of
https://github.com/awslabs/aws-crt-php.git
synced 2026-08-18 01:57:13 +00:00
Organized modules, added indirection for FFI vs extension loading (#10)
* mv src -> ext, lib -> src to be more in line with PHP module expectations * Fixed dependency for ffi test * Fixed path in format-check to C source * CRT will now try the extension first, then FFI
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
|
||||
#ifndef PHP_AWS_CRT_H
|
||||
#define PHP_AWS_CRT_H
|
||||
|
||||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "php.h"
|
||||
|
||||
#include "Zend/zend_extensions.h" /* for ZEND_EXTENSION_API_NO */
|
||||
|
||||
#if ZEND_EXTENSION_API_NO < 220131226
|
||||
# error "PHP >= 5.6 is required"
|
||||
#endif
|
||||
|
||||
#define AWS_PHP_AT_LEAST_7 defined(ZEND_EXTENSION_API_NO_7_0_X) || (ZEND_EXTENSION_API_NO >= 320151012)
|
||||
|
||||
ZEND_BEGIN_MODULE_GLOBALS(awscrt)
|
||||
long log_level;
|
||||
ZEND_END_MODULE_GLOBALS(awscrt)
|
||||
|
||||
ZEND_EXTERN_MODULE_GLOBALS(awscrt)
|
||||
|
||||
#define AWSCRT_GLOBAL(v) ZEND_MODULE_GLOBALS_ACCESSOR(awscrt, v)
|
||||
|
||||
/* PHP 7 removed the string duplicate parameter */
|
||||
#if AWS_PHP_AT_LEAST_7
|
||||
# define AWS_RETURN_STRING(s) RETURN_STRING(s)
|
||||
#else
|
||||
# define AWS_RETURN_STRING(s) RETURN_STRING(s, 1)
|
||||
#endif
|
||||
|
||||
#endif /* PHP_AWS_CRT_H */
|
||||
Reference in New Issue
Block a user