ODBC Patch

Started by Dave Pageover 25 years ago12 messagespatches
Jump to latest
#1Dave Page
dpage@pgadmin.org

This patch fixes resource.h which is generated automatically by MS VC++ and
broken by pgindent :-(

Regards,

Dave.

#2Dave Page
dpage@pgadmin.org
In reply to: Dave Page (#1)
RE: ODBC Patch

Helps if I actually attach it!

Show quoted text

-----Original Message-----
From: Dave Page [mailto:dpage@vale-housing.co.uk]
Sent: 12 February 2001 08:00
To: pgsql-patches@postgresql.org
Subject: [PATCHES] ODBC Patch

This patch fixes resource.h which is generated automatically
by MS VC++ and
broken by pgindent :-(

Regards,

Dave.

Attachments:

odbc.diffapplication/octet-stream; name=odbc.diffDownload+113-113
#3Bruce Momjian
bruce@momjian.us
In reply to: Dave Page (#2)
Re: ODBC Patch

Dave, can you test the attached patch? I assume the problem was that
pgindent does not recognize // as comments, and in fact, we don't want
to use them.

This should fix the problem.

[ Charset ISO-8859-1 unsupported, converting... ]

Helps if I actually attach it!

-----Original Message-----
From: Dave Page [mailto:dpage@vale-housing.co.uk]
Sent: 12 February 2001 08:00
To: pgsql-patches@postgresql.org
Subject: [PATCHES] ODBC Patch

This patch fixes resource.h which is generated automatically
by MS VC++ and
broken by pgindent :-(

Regards,

Dave.

[ Attachment, skipping... ]

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Attachments:

/bjm/difftext/plainDownload+11-14
#4Dave Page
dpage@pgadmin.org
In reply to: Bruce Momjian (#3)
RE: ODBC Patch

-----Original Message-----
From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
Sent: 12 February 2001 12:59
To: Dave Page
Cc: 'pgsql-patches@postgresql.org'
Subject: Re: [PATCHES] ODBC Patch

Dave, can you test the attached patch? I assume the problem was that
pgindent does not recognize // as comments, and in fact, we don't want
to use them.

This should fix the problem.

I've not tested it (I'm just configuring my new laptop :-) ) but that should
work (and has done - if you look back in CVS I made that mod before). The
problem is that MS VC++ autogenerates resource.h whenever psqlodbc.rc is
updated in the IDE. Is it possible to get pgindent to ignore that file or
would that cause more problems?

Regards, Dave.

#5Bruce Momjian
bruce@momjian.us
In reply to: Dave Page (#4)
Re: ODBC Patch

Dave, can you test the attached patch? I assume the problem was that
pgindent does not recognize // as comments, and in fact, we don't want
to use them.

This should fix the problem.

I've not tested it (I'm just configuring my new laptop :-) ) but that should
work (and has done - if you look back in CVS I made that mod before). The
problem is that MS VC++ autogenerates resource.h whenever psqlodbc.rc is
updated in the IDE. Is it possible to get pgindent to ignore that file or
would that cause more problems?

Sure, we can ignore it, but do we want an MS-generated file to be
tracked in our CVS, and especially one with // comments?

If resource.h was included only by MS compilers, that would be better,
but I see every platform including the file.

Can you send me that resource.h file again, and I will merge in any
change made by *.rc, but keep the /* */ comments, OK?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#5)
Re: ODBC Patch

Bruce Momjian <pgman@candle.pha.pa.us> writes:

problem is that MS VC++ autogenerates resource.h whenever psqlodbc.rc is
updated in the IDE. Is it possible to get pgindent to ignore that file or
would that cause more problems?

Sure, we can ignore it, but do we want an MS-generated file to be
tracked in our CVS, and especially one with // comments?
If resource.h was included only by MS compilers, that would be better,
but I see every platform including the file.

Good point. This will not be buildable on machines whose compilers do
not like //.

Can you send me that resource.h file again, and I will merge in any
change made by *.rc, but keep the /* */ comments, OK?

I don't think that's a feasible long-term maintenance approach either.
Will you or Dave remember to do this any time psqlodbc.rc changes?

Seems like the correct answer is for pgindent to automatically transform
"// comment" to "/* comment */".

regards, tom lane

#7Dave Page
dpage@pgadmin.org
In reply to: Tom Lane (#6)
RE: ODBC Patch

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: 12 February 2001 15:19
To: Bruce Momjian
Cc: Dave Page; 'pgsql-patches@postgresql.org'
Subject: Re: [PATCHES] ODBC Patch

Bruce Momjian <pgman@candle.pha.pa.us> writes:

problem is that MS VC++ autogenerates resource.h whenever

psqlodbc.rc is

updated in the IDE. Is it possible to get pgindent to

ignore that file or

would that cause more problems?

Sure, we can ignore it, but do we want an MS-generated file to be
tracked in our CVS, and especially one with // comments?
If resource.h was included only by MS compilers, that would

be better,

but I see every platform including the file.

Good point. This will not be buildable on machines whose compilers do
not like //.

Can you send me that resource.h file again, and I will merge in any
change made by *.rc, but keep the /* */ comments, OK?

I don't think that's a feasible long-term maintenance approach either.
Will you or Dave remember to do this any time psqlodbc.rc changes?

I can certainly do this anytime I update the driver, but I obviously can't
keep track of other people who change it. IMHO it (psqlodbc.rc) should be
updated for every patch submitted as it (along with psqlodbc.h) contain the
revision number which is essential for the ODBC driver which is often
updated outside of the main PostgreSQL releases.

Seems like the correct answer is for pgindent to
automatically transform
"// comment" to "/* comment */".

This sounds much more sensible.

Regards,

Dave.

#8Dave Page
dpage@pgadmin.org
In reply to: Dave Page (#7)
RE: ODBC Patch

-----Original Message-----
From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
Sent: 12 February 2001 14:12
To: Dave Page
Cc: 'pgsql-patches@postgresql.org'
Subject: Re: [PATCHES] ODBC Patch

Dave, can you test the attached patch? I assume the

problem was that

pgindent does not recognize // as comments, and in fact,

we don't want

to use them.

This should fix the problem.

I've not tested it (I'm just configuring my new laptop :-)

) but that should

work (and has done - if you look back in CVS I made that

mod before). The

problem is that MS VC++ autogenerates resource.h whenever

psqlodbc.rc is

updated in the IDE. Is it possible to get pgindent to

ignore that file or

would that cause more problems?

Sure, we can ignore it, but do we want an MS-generated file to be
tracked in our CVS, and especially one with // comments?

If resource.h was included only by MS compilers, that would be better,
but I see every platform including the file.

Can you send me that resource.h file again, and I will merge in any
change made by *.rc, but keep the /* */ comments, OK?

Here's the (working) file with C style comments.

I've made comments on the subject in a reply to Tom's message...

Regards, Dave.

Attachments:

resource.happlication/octet-stream; name=resource.hDownload
#9Bruce Momjian
bruce@momjian.us
In reply to: Dave Page (#8)
Re: ODBC Patch

Applied. Thanks.

[ Charset ISO-8859-1 unsupported, converting... ]

-----Original Message-----
From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
Sent: 12 February 2001 14:12
To: Dave Page
Cc: 'pgsql-patches@postgresql.org'
Subject: Re: [PATCHES] ODBC Patch

Dave, can you test the attached patch? I assume the

problem was that

pgindent does not recognize // as comments, and in fact,

we don't want

to use them.

This should fix the problem.

I've not tested it (I'm just configuring my new laptop :-)

) but that should

work (and has done - if you look back in CVS I made that

mod before). The

problem is that MS VC++ autogenerates resource.h whenever

psqlodbc.rc is

updated in the IDE. Is it possible to get pgindent to

ignore that file or

would that cause more problems?

Sure, we can ignore it, but do we want an MS-generated file to be
tracked in our CVS, and especially one with // comments?

If resource.h was included only by MS compilers, that would be better,
but I see every platform including the file.

Can you send me that resource.h file again, and I will merge in any
change made by *.rc, but keep the /* */ comments, OK?

Here's the (working) file with C style comments.

I've made comments on the subject in a reply to Tom's message...

Regards, Dave.

[ Attachment, skipping... ]

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#10Bruce Momjian
bruce@momjian.us
In reply to: Dave Page (#7)
Re: ODBC Patch

Can you send me that resource.h file again, and I will merge in any
change made by *.rc, but keep the /* */ comments, OK?

I don't think that's a feasible long-term maintenance approach either.
Will you or Dave remember to do this any time psqlodbc.rc changes?

I can certainly do this anytime I update the driver, but I obviously can't
keep track of other people who change it. IMHO it (psqlodbc.rc) should be
updated for every patch submitted as it (along with psqlodbc.h) contain the
revision number which is essential for the ODBC driver which is often
updated outside of the main PostgreSQL releases.

It is my understanding that resource.h is changed only when a new
option is added t psqlodbc.rc. It does not change with a version number
change because resource.h doesn't contain a version number.

Seems like the correct answer is for pgindent to
automatically transform
"// comment" to "/* comment */".

This sounds much more sensible.

Sure, I can do that. I can have pgindent convert:

// comment

to

/* comment */

Dave, can you send me the MS-generated resource.h for me to test with
and cvs commit? Thanks.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#11Dave Page
dpage@pgadmin.org
In reply to: Bruce Momjian (#10)
RE: ODBC Patch

-----Original Message-----
From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
Sent: 12 February 2001 18:32
To: Dave Page
Cc: 'Tom Lane'; 'pgsql-patches@postgresql.org'
Subject: Re: [PATCHES] ODBC Patch

It is my understanding that resource.h is changed only when a new
option is added t psqlodbc.rc. It does not change with a
version number
change because resource.h doesn't contain a version number.

I've just tested with MS VC++ SP4 and it will not update psqlodbc.rc without
rewriting resource.h even if you only change the version number. If you say
No when prompted to update resource.h, it then doesn't update psqlodbc.rc
either.

Dave, can you send me the MS-generated resource.h for me to test with
and cvs commit? Thanks.

Attached.

Regards, Dave.

Attachments:

resource.happlication/octet-stream; name=resource.hDownload
#12Bruce Momjian
bruce@momjian.us
In reply to: Dave Page (#11)
Re: ODBC Patch

OK, attached is the resource.h file, run through pgindent. Looks good.
Committed.

[ Charset ISO-8859-1 unsupported, converting... ]

-----Original Message-----
From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
Sent: 12 February 2001 18:32
To: Dave Page
Cc: 'Tom Lane'; 'pgsql-patches@postgresql.org'
Subject: Re: [PATCHES] ODBC Patch

It is my understanding that resource.h is changed only when a new
option is added t psqlodbc.rc. It does not change with a
version number
change because resource.h doesn't contain a version number.

I've just tested with MS VC++ SP4 and it will not update psqlodbc.rc without
rewriting resource.h even if you only change the version number. If you say
No when prompted to update resource.h, it then doesn't update psqlodbc.rc
either.

Dave, can you send me the MS-generated resource.h for me to test with
and cvs commit? Thanks.

Attached.

Regards, Dave.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Attachments:

/pg/interfaces/odbc/resource.htext/plainDownload