Skip to content

Commit c27090b

Browse files
committed
Convert some extern variables to static, Windows code
Similar to 720b0ea, discovered by MinGW.
1 parent 6bbbd7f commit c27090b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/bin/pg_upgrade/parallel.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static int parallel_jobs;
2424
* it can be passed to WaitForMultipleObjects(). We use two arrays
2525
* so the thread_handles array can be passed to WaitForMultipleObjects().
2626
*/
27-
HANDLE *thread_handles;
27+
static HANDLE *thread_handles;
2828

2929
typedef struct
3030
{
@@ -42,11 +42,11 @@ typedef struct
4242
char *old_tablespace;
4343
} transfer_thread_arg;
4444

45-
exec_thread_arg **exec_thread_args;
46-
transfer_thread_arg **transfer_thread_args;
45+
static exec_thread_arg **exec_thread_args;
46+
static transfer_thread_arg **transfer_thread_args;
4747

4848
/* track current thread_args struct so reap_child() can be used for all cases */
49-
void **cur_thread_args;
49+
static void **cur_thread_args;
5050

5151
DWORD win32_exec_prog(exec_thread_arg *args);
5252
DWORD win32_transfer_all_new_dbs(transfer_thread_arg *args);

src/bin/pgevent/pgevent.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
#include <olectl.h>
1616

1717
/* Global variables */
18-
HANDLE g_module = NULL; /* hModule of DLL */
18+
static HANDLE g_module = NULL; /* hModule of DLL */
1919

2020
/*
2121
* The event source is stored as a registry key.
2222
* The maximum length of a registry key is 255 characters.
2323
* http://msdn.microsoft.com/en-us/library/ms724872(v=vs.85).aspx
2424
*/
25-
char event_source[256] = DEFAULT_EVENT_SOURCE;
25+
static char event_source[256] = DEFAULT_EVENT_SOURCE;
2626

2727
/* Prototypes */
2828
HRESULT DllInstall(BOOL bInstall, LPCWSTR pszCmdLine);

src/common/restricted_token.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#ifdef WIN32
2727

2828
/* internal vars */
29-
char *restrict_env;
29+
static char *restrict_env;
3030

3131
/* Windows API define missing from some versions of MingW headers */
3232
#ifndef DISABLE_MAX_PRIVILEGE

src/interfaces/libpq/win32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ LookupWSErrorMessage(DWORD err, char *dest)
231231
}
232232

233233

234-
struct MessageDLL
234+
static struct MessageDLL
235235
{
236236
const char *dll_name;
237237
void *handle;

0 commit comments

Comments
 (0)