11/* dynamic SQL support routines
22 *
3- * $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.26 2007/10/0311:11:12 meskes Exp $
3+ * $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.27 2007/10/0316:03:25 tgl Exp $
44 */
55
66#define POSTGRES_ECPG_INTERNAL
1616#include "sql3types.h"
1717
1818static void descriptor_free (struct descriptor * desc );
19- static void descriptor_deallocate_all (struct descriptor * list );
2019
2120/* We manage descriptors separately for each thread. */
2221#ifdef ENABLE_THREAD_SAFETY
2322static pthread_key_t descriptor_key ;
2423static pthread_once_t descriptor_once = PTHREAD_ONCE_INIT ;
2524
25+ static void descriptor_deallocate_all (struct descriptor * list );
26+
2627static void
2728descriptor_destructor (void * arg )
2829{
@@ -653,6 +654,8 @@ ECPGdeallocate_desc(int line, const char *name)
653654return false;
654655}
655656
657+ #ifdef ENABLE_THREAD_SAFETY
658+
656659/* Deallocate all descriptors in the list */
657660static void
658661descriptor_deallocate_all (struct descriptor * list )
@@ -665,6 +668,8 @@ descriptor_deallocate_all(struct descriptor *list)
665668}
666669}
667670
671+ #endif /* ENABLE_THREAD_SAFETY */
672+
668673bool
669674ECPGallocate_desc (int line ,const char * name )
670675{