Line data Source code
1 : /* Copyright 2018 Wikimedia Foundation 2 : * 3 : * Licensed under the Apache License, Version 2.0 (the "License"); 4 : * you may not use this file except in compliance with the License. 5 : * You may obtain a copy of the License at 6 : * 7 : * http://www.apache.org/licenses/LICENSE-2.0 8 : * 9 : * Unless required by applicable law or agreed to in writing, software 10 : * distributed under the License is distributed on an "AS IS" BASIS, 11 : * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 : * See the License for the specific language governing permissions and 13 : * limitations under the License. 14 : */ 15 : 16 : #ifndef PHP_EXCIMER_H 17 : #define PHP_EXCIMER_H 18 : 19 : extern zend_module_entry excimer_module_entry; 20 : #define phpext_excimer_ptr &excimer_module_entry 21 : 22 : #define PHP_EXCIMER_VERSION "1.2.5" 23 : 24 : #ifdef PHP_WIN32 25 : # define PHP_EXCIMER_API __declspec(dllexport) 26 : #elif defined(__GNUC__) && __GNUC__ >= 4 27 : # define PHP_EXCIMER_API __attribute__ ((visibility("default"))) 28 : #else 29 : # define PHP_EXCIMER_API 30 : #endif 31 : 32 : #ifdef ZTS 33 : #include "TSRM.h" 34 : #endif 35 : 36 : #if defined(ZTS) && defined(COMPILE_DL_EXCIMER) 37 : ZEND_TSRMLS_CACHE_EXTERN() 38 : #endif 39 : 40 280 : static inline uint32_t excimer_safe_uint32(zend_long i) { 41 280 : if (i < 0 || i > UINT32_MAX) { 42 0 : zend_error_noreturn(E_ERROR, "Integer out of range"); 43 : } 44 280 : return (uint32_t)i; 45 : } 46 : 47 : #endif /* PHP_EXCIMER_H */ 48 : 49 : 50 : /* 51 : * Local variables: 52 : * tab-width: 4 53 : * c-basic-offset: 4 54 : * End: 55 : * vim600: noet sw=4 ts=4 fdm=marker 56 : * vim<600: noet sw=4 ts=4 57 : */