Skip to content

Commit

Permalink
fix for older PostgreSQL definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Jul 6, 2018
1 parent e0ab992 commit 76c088a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions iplike.c
Original file line number Diff line number Diff line change
Expand Up @@ -1202,10 +1202,17 @@ const bool _iplike(const text *const value, const text *const rule)
*/
#ifdef PG_FUNCTION_INFO_V1
PG_FUNCTION_INFO_V1(iplike);

#ifdef PG_GETARG_TEXT_PP
#define IPLIKE_GETARG_TEXT PG_GETARG_TEXT_PP
#else
#define IPLIKE_GETARG_TEXT PG_GETARG_TEXT_P
#endif

Datum iplike(PG_FUNCTION_ARGS)
{
const text *const value = PG_GETARG_TEXT_PP(0);
const text *const rule = PG_GETARG_TEXT_PP(1);
const text *const value = IPLIKE_GETARG_TEXT(0);
const text *const rule = IPLIKE_GETARG_TEXT(1);
const bool rcode = _iplike(value, rule);
PG_RETURN_BOOL(rcode);
}
Expand Down

0 comments on commit 76c088a

Please sign in to comment.