Skip to content

Commit 49c534f

Browse files
committed
Throw compile error if our non-thread-safe snprintf is used.
1 parent 8c3f859 commit 49c534f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/port/snprintf.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
/* might be in either frontend or backend */
3636
#include "postgres_fe.h"
3737

38+
#ifdef ENABLE_THREAD_SAFETY
39+
#error The replacement snprintf() is not thread-safe. \
40+
Your platform must have a thread-safe snprintf() to compile with threads.
41+
#endif
42+
3843
#include <sys/ioctl.h>
3944
#include <sys/param.h>
4045

@@ -74,7 +79,7 @@ typedef unsigned long ulong_long;
7479
* causing nast effects.
7580
**************************************************************/
7681

77-
/*static char _id[] = "$PostgreSQL: pgsql/src/port/snprintf.c,v 1.2 2003/11/29 22:41:31 pgsql Exp $";*/
82+
/*static char _id[] = "$PostgreSQL: pgsql/src/port/snprintf.c,v 1.3 2004/01/08 17:15:54 momjian Exp $";*/
7883
static char *end;
7984
static int SnprfOverflow;
8085

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy