Win32 patch to allow compilation

Started by Bruce Momjianabout 23 years ago5 messagespatches
Jump to latest
#1Bruce Momjian
bruce@momjian.us

I have applied the following patch to allow Win32 compilation under
MinGW. The patch includes the following changes:

Win32 port is now called 'win32' rather than 'win'
add -lwsock32 on Win32
make gethostname() be only used when kerberos4 is enabled
use /port/getopt.c
new /port/opendir.c routines
disable GUC unix_socket_group on Win32
convert some keywords.c symbols to KEYWORD_P to prevent conflict
create new FCNTL_NONBLOCK macro to turn off socket blocking
create new /include/port.h file that has /port prototypes, move
out of c.h
new /include/port/win32_include dir to hold missing include files
work around ERROR being defined in Win32 includes

As I said on hackers, these changes are minor.

This patch passes all compile/regression tests under Unix.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Attachments:

/pgpatches/win32/compiletext/plainDownload+457-272
#2Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#1)
Re: Win32 patch to allow compilation

Bruce Momjian writes:

I have applied the following patch to allow Win32 compilation under
MinGW. The patch includes the following changes:

Win32 port is now called 'win32' rather than 'win'

I think this is wrong-headed. What's the reason?

new /include/port/win32_include dir to hold missing include files

For the other ports we have simply named this directory after the name of
the port. Appending "_include" is redundant.

--
Peter Eisentraut peter_e@gmx.net

#3Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#2)
Re: Win32 patch to allow compilation

Peter Eisentraut wrote:

Bruce Momjian writes:

I have applied the following patch to allow Win32 compilation under
MinGW. The patch includes the following changes:

Win32 port is now called 'win32' rather than 'win'

I think this is wrong-headed. What's the reason?

I don't think 'win' is unique enough. Win32 seems the more official
designation.

new /include/port/win32_include dir to hold missing include files

For the other ports we have simply named this directory after the name of
the port. Appending "_include" is redundant.

Well, we don't have any other port directories under /include/port, but
I see your point that they are include files, so why add _include. I
will make the change.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#4Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#3)
Re: Win32 patch to allow compilation

Bruce Momjian writes:

I don't think 'win' is unique enough. Win32 seems the more official
designation.

We've lived with a "win" port for years and no one complained about that.
And what will happen when "win64" comes around? The official designation
is Windows anyway.

Well, we don't have any other port directories under /include/port,

Hmm, there used to be some. Maybe they aren't needed anymore.

--
Peter Eisentraut peter_e@gmx.net

#5Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#4)
Re: Win32 patch to allow compilation

Peter Eisentraut wrote:

Bruce Momjian writes:

I don't think 'win' is unique enough. Win32 seems the more official
designation.

We've lived with a "win" port for years and no one complained about that.
And what will happen when "win64" comes around? The official designation
is Windows anyway.

OK, I have renamed win32_include to win32. I used win32 because that is
the symbol we test for in the C code, so it seemed it made sense to be
consistent. How about MSWIN? That is more unique than win. What
symbol do we test for in the C code? __mswin__?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073