TIDBitmap *tbm;
TBMIterator *tbmiterator;
TBMIterateResult *tbmres;
+#ifdef USE_PREFETCH
TBMIterator *prefetch_iterator;
+#endif
OffsetNumber targoffset;
TupleTableSlot *slot;
tbm = node->tbm;
tbmiterator = node->tbmiterator;
tbmres = node->tbmres;
+#ifdef USE_PREFETCH
prefetch_iterator = node->prefetch_iterator;
+#endif
/*
* If we haven't yet performed the underlying index scan, do it, and begin
#endif /* USE_WIDE_UPPER_LOWER */
else
{
+#ifdef HAVE_LOCALE_T
pg_locale_t mylocale = 0;
+#endif
char *p;
if (collid != DEFAULT_COLLATION_OID)
errmsg("could not determine which collation to use for lower() function"),
errhint("Use the COLLATE clause to set the collation explicitly.")));
}
+#ifdef HAVE_LOCALE_T
mylocale = pg_newlocale_from_collation(collid);
+#endif
}
result = pnstrdup(buff, nbytes);
#endif /* USE_WIDE_UPPER_LOWER */
else
{
+#ifdef HAVE_LOCALE_T
pg_locale_t mylocale = 0;
+#endif
char *p;
if (collid != DEFAULT_COLLATION_OID)
errmsg("could not determine which collation to use for upper() function"),
errhint("Use the COLLATE clause to set the collation explicitly.")));
}
+#ifdef HAVE_LOCALE_T
mylocale = pg_newlocale_from_collation(collid);
+#endif
}
result = pnstrdup(buff, nbytes);
#endif /* USE_WIDE_UPPER_LOWER */
else
{
+#ifdef HAVE_LOCALE_T
pg_locale_t mylocale = 0;
+#endif
char *p;
if (collid != DEFAULT_COLLATION_OID)
errmsg("could not determine which collation to use for initcap() function"),
errhint("Use the COLLATE clause to set the collation explicitly.")));
}
+#ifdef HAVE_LOCALE_T
mylocale = pg_newlocale_from_collation(collid);
+#endif
}
result = pnstrdup(buff, nbytes);
char a2buf[STACKBUFLEN];
char *a1p,
*a2p;
+#ifdef HAVE_LOCALE_T
pg_locale_t mylocale = 0;
+#endif
if (collid != DEFAULT_COLLATION_OID)
{
errmsg("could not determine which collation to use for string comparison"),
errhint("Use the COLLATE clause to set the collation explicitly.")));
}
+#ifdef HAVE_LOCALE_T
mylocale = pg_newlocale_from_collation(collid);
+#endif
}
#ifdef WIN32
return true;
}
-#ifdef WIN32
-
-/*
- * Replace 'needle' with 'replacement' in 'str' . Note that the replacement
- * is done in-place, so 'replacement' must be shorter than 'needle'.
- */
-static void
-strreplace(char *str, char *needle, char *replacement)
-{
- char *s;
-
- s = strstr(str, needle);
- if (s != NULL)
- {
- int replacementlen = strlen(replacement);
- char *rest = s + strlen(needle);
-
- memcpy(s, replacement, replacementlen);
- memmove(s + replacementlen, rest, strlen(rest) + 1);
- }
-}
-#endif /* WIN32 */
-
/*
* set up the locale variables
*
/* End position for xlog streaming, empty string if unknown yet */
static XLogRecPtr xlogendptr;
+#ifndef WIN32
static int has_xlogendptr = 0;
+#else
+static volatile LONG has_xlogendptr = 0;
+#endif
/* Function headers */
static void usage(void);
if (bgchild > 0)
{
- int status;
-
#ifndef WIN32
+ int status;
int r;
+#else
+ DWORD status;
#endif
if (verbose)
if (status != 0)
{
fprintf(stderr, _("%s: child thread exited with error %u\n"),
- progname, status);
+ progname, (unsigned int) status);
disconnect_and_exit(1);
}
/* Exited normally, we're happy */
* When sigint is called, just tell the system to exit at the next possible
* moment.
*/
+#ifndef WIN32
+
static void
sigint_handler(int signum)
{
time_to_abort = true;
}
+#endif
+
int
main(int argc, char **argv)
{
{
PROCESS_INFORMATION pi;
DWORD ret;
- DWORD check_point_start;
/* Initialize variables */
status.dwWin32ExitCode = S_OK;
write_eventlog(EVENTLOG_INFORMATION_TYPE, _("Server started and accepting connections\n"));
}
- /*
- * Save the checkpoint value as it might have been incremented in
- * test_postmaster_connection
- */
- check_point_start = status.dwCheckPoint;
-
pgwin32_SetServiceStatus(SERVICE_RUNNING);
/* Wait for quit... */
DllInstall(BOOL bInstall,
LPCWSTR pszCmdLine)
{
- size_t ret;
if (pszCmdLine && *pszCmdLine != '\0')
wcstombs(event_source, pszCmdLine, sizeof(event_source));
date0;
double time;
#endif
- time_t utime;
-
#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
+ time_t utime;
struct tm *tx;
#endif
*/
if (IS_VALID_UTIME(tm->tm_year, tm->tm_mon, tm->tm_mday))
{
+#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
+
#ifdef HAVE_INT64_TIMESTAMP
utime = dt / USECS_PER_SEC +
((date0 - date2j(1970, 1, 1)) * INT64CONST(86400));
utime = dt + (date0 - date2j(1970, 1, 1)) * SECS_PER_DAY;
#endif
-#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
tx = localtime(&utime);
tm->tm_year = tx->tm_year + 1900;
tm->tm_mon = tx->tm_mon + 1;