Skip to content
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 config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ if test "$MONGODB" != "no"; then
PHP_CHECK_GCC_ARG(-Wparentheses, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wparentheses")
PHP_CHECK_GCC_ARG(-Wdeclaration-after-statement, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wdeclaration-after-statement")
PHP_CHECK_GCC_ARG(-Wmaybe-uninitialized, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wmaybe-uninitialized")
PHP_CHECK_GCC_ARG(-Wimplicit-fallthrough, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wimplicit-fallthrough")
PHP_CHECK_GCC_ARG(-Werror, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Werror")
PHP_CHECK_GCC_ARG(-Wextra, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wextra")
PHP_CHECK_GCC_ARG(-Wno-unused-parameter, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-unused-parameter")
Expand Down
15 changes: 15 additions & 0 deletions phongo_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,21 @@
# define ARG_UNUSED
#endif

#if defined (__GNUC__)
# define PHONGO_GNUC_CHECK_VERSION(major, minor) \
((__GNUC__ > (major)) || \
((__GNUC__ == (major)) && (__GNUC_MINOR__ >= (minor))))
#else
# define PHONGO_GNUC_CHECK_VERSION(major, minor) 0
#endif

#if PHONGO_GNUC_CHECK_VERSION(7, 0)
# define PHONGO_BREAK_INTENTIONALLY_MISSING __attribute__ ((fallthrough));
#else
# define PHONGO_BREAK_INTENTIONALLY_MISSING
#endif


#if PHP_VERSION_ID >= 70000
# define phongo_char zend_string
# define phongo_long zend_long
Expand Down
3 changes: 2 additions & 1 deletion src/bson-encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ static void php_phongo_bson_append(bson_t *bson, php_phongo_bson_flags_t flags,
}
break;
}
/* break intentionally omitted */
PHONGO_BREAK_INTENTIONALLY_MISSING

case IS_OBJECT: {
HashTable *tmp_ht = HASH_OF(entry);

Expand Down