Skip to content

Commit 9515471

Browse files
author
Sandro Santilli
committed
Add an lwpgwarning function, for those who worry !
git-svn-id: http://svn.osgeo.org/postgis/trunk@13683 b70326c6-7e19-0410-871a-916f4a2858ee
1 parent c530ee4 commit 9515471

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

libpgcommon/lwgeom_pg.c

+23
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,17 @@ pg_error(const char *fmt, va_list ap)
162162
ereport(ERROR, (errmsg_internal("%s", errmsg)));
163163
}
164164

165+
static void
166+
pg_warning(const char *fmt, va_list ap)
167+
{
168+
char errmsg[PGC_ERRMSG_MAXLEN+1];
169+
170+
vsnprintf (errmsg, PGC_ERRMSG_MAXLEN, fmt, ap);
171+
172+
errmsg[PGC_ERRMSG_MAXLEN]='\0';
173+
ereport(WARNING, (errmsg_internal("%s", errmsg)));
174+
}
175+
165176
static void
166177
pg_notice(const char *fmt, va_list ap)
167178
{
@@ -245,6 +256,18 @@ lwpgnotice(const char *fmt, ...)
245256
va_end(ap);
246257
}
247258

259+
void
260+
lwpgwarning(const char *fmt, ...)
261+
{
262+
va_list ap;
263+
264+
va_start(ap, fmt);
265+
266+
pg_warning(fmt, ap);
267+
268+
va_end(ap);
269+
}
270+
248271
void
249272
lwpgerror(const char *fmt, ...)
250273
{

libpgcommon/lwgeom_pg.h

+1
Original file line numberDiff line numberDiff line change
@@ -172,5 +172,6 @@ Datum LWGEOM_dropBBOX(PG_FUNCTION_ARGS);
172172

173173
void lwpgerror(const char *fmt, ...);
174174
void lwpgnotice(const char *fmt, ...);
175+
void lwpgwarning(const char *fmt, ...);
175176

176177
#endif /* !defined _LWGEOM_PG_H */

0 commit comments

Comments
 (0)