~ubuntu-branches/ubuntu/lucid/postgresql-8.4/lucid-proposed

« back to all changes in this revision

Viewing changes to src/interfaces/ecpg/ecpglib/misc.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-11 16:59:35 UTC
  • mfrom: (5.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090711165935-jfwin6gfrxf0gfsi
Tags: 8.4.0-2
* debian/libpq-dev.install: Ship catalog/genbki.h. (Closes: #536139)
* debian/rules: Drop --enable-cassert for final release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.48 2009/01/15 11:52:55 petere Exp $ */
 
1
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.49 2009/06/11 14:49:13 momjian Exp $ */
2
2
 
3
3
#define POSTGRES_ECPG_INTERNAL
4
4
#include "postgres_fe.h"
241
241
ecpg_log(const char *format,...)
242
242
{
243
243
        va_list         ap;
244
 
        struct sqlca_t  *sqlca = ECPGget_sqlca();
 
244
        struct sqlca_t *sqlca = ECPGget_sqlca();
245
245
        const char *intl_format;
246
246
        int                     bufsize;
247
 
        char            *fmt;
 
247
        char       *fmt;
248
248
 
249
249
        if (!simple_debug)
250
250
                return;
253
253
        intl_format = ecpg_gettext(format);
254
254
 
255
255
        /*
256
 
         * Insert PID into the format, unless ecpg_internal_regression_mode is
257
 
         * set (regression tests want unchanging output).
 
256
         * Insert PID into the format, unless ecpg_internal_regression_mode is set
 
257
         * (regression tests want unchanging output).
258
258
         */
259
259
        bufsize = strlen(intl_format) + 100;
260
260
        fmt = (char *) malloc(bufsize);
426
426
{
427
427
        if (mutex->handle == NULL)
428
428
        {
429
 
                while (InterlockedExchange((LONG *) & mutex->initlock, 1) == 1)
 
429
                while (InterlockedExchange((LONG *) &mutex->initlock, 1) == 1)
430
430
                        Sleep(0);
431
431
                if (mutex->handle == NULL)
432
432
                        mutex->handle = CreateMutex(NULL, FALSE, NULL);
433
 
                InterlockedExchange((LONG *) & mutex->initlock, 0);
 
433
                InterlockedExchange((LONG *) &mutex->initlock, 0);
434
434
        }
435
435
}
436
436
 
451
451
        }
452
452
}
453
453
#endif   /* ENABLE_THREAD_SAFETY */
454
 
 
455
454
#endif   /* WIN32 */
456
455
 
457
456
#ifdef ENABLE_NLS