Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 22867ab

Browse files
committed
Use _USE_32BIT_TIME_T when building with MSVC. Also, enforce that it's
used when building addons. Dave Page
1 parent 4192f2d commit 22867ab

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/include/port/win32.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.81 2007/11/24 01:55:26 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.82 2007/12/11 14:34:43 mha Exp $ */
22

33
#if defined(_MSC_VER) || defined(__BORLANDC__)
44
#define WIN32_ONLY_COMPILER
@@ -45,6 +45,17 @@
4545

4646
#define USES_WINSOCK
4747

48+
/*
49+
* Ensure that anyone building an extension is using a 32 bit time_t.
50+
* On Mingw/Msys, that should always be the case, but MSVC++ defaults
51+
* to 64 bits. We set that for our own build in the project files
52+
*/
53+
#ifdef WIN32_ONLY_COMPILER
54+
#ifndef _USE_32BIT_TIME_T
55+
#error "Postgres uses 32 bit time_t - add #define _USE_32BIT_TIME_T on Windows"
56+
#endif
57+
#endif
58+
4859
/* defines for dynamic linking on Win32 platform */
4960
#if defined(WIN32) || defined(__CYGWIN__)
5061

src/tools/msvc/Project.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package Project;
33
#
44
# Package that encapsulates a Visual C++ project file generation
55
#
6-
# $PostgreSQL: pgsql/src/tools/msvc/Project.pm,v 1.14 2007/08/21 15:10:41 mha Exp $
6+
# $PostgreSQL: pgsql/src/tools/msvc/Project.pm,v 1.15 2007/12/11 14:34:43 mha Exp $
77
#
88
use Carp;
99
use strict;
@@ -489,7 +489,7 @@ sub WriteConfiguration
489489
ConfigurationType="$cfgtype" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2" WholeProgramOptimization="$p->{wholeopt}">
490490
<Tool Name="VCCLCompilerTool" Optimization="$p->{opt}"
491491
AdditionalIncludeDirectories="$self->{prefixincludes}src/include;src/include/port/win32;src/include/port/win32_msvc;$self->{includes}"
492-
PreprocessorDefinitions="WIN32;_WINDOWS;__WINDOWS__;__WIN32__;EXEC_BACKEND;WIN32_STACK_RLIMIT=4194304;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE$self->{defines}$p->{defs}"
492+
PreprocessorDefinitions="WIN32;_WINDOWS;__WINDOWS__;__WIN32__;EXEC_BACKEND;WIN32_STACK_RLIMIT=4194304;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T$self->{defines}$p->{defs}"
493493
StringPooling="$p->{strpool}"
494494
RuntimeLibrary="$p->{runtime}" DisableSpecificWarnings="$self->{disablewarnings}"
495495
EOF

0 commit comments

Comments
 (0)