Subject: Win32 API Headers and C++
From: [email-masked] (Colin Peters)

5 Nov 1996 00:09:29 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: [email-masked]
Original-Sender: [email-masked]

I just compiled a simple C++ program using the windows32api-0.1.2 header
files and had it fail to compiler with "syntax error before __attribute__"
in the header files. These errors seem to be related to functions which
return pointers and have the __attribute__((__stdcall__)) attribute (which
all the API functions have). It seems that a declaration like:

LPWSTR *
STDCALL
CommandLineToArgv (
 ...

Will not be properly interpreted by the C++ compiler (the C compiler has
no problem with it). Changing the prototype to

STDCALL
LPWSTR *
CommandLineToArgv (
 ...

Makes the errors go away, and seems to work correctly, but I wonder if it
might break something or otherwise be a bad idea to do it this way.

Since these header files have (apparently) been integrated into GCC for the
next release, presumably someone has already solved this. I would like to know
what the "official" solution is. Is it a change to the compiler code or just
in the header files? If in the header files is it the above change or
something different?

Thanks,
Colin.

------------------------------------------------------------------------------
Colin Peters ------------ Saga Univ. Dept. of Information Science, Saga, JAPAN
http://www.fu.is.saga-u.ac.jp/~colin/home.html - [email-masked]
コリン ピーターズ - 佐賀大学理工学部情報科学科情報基礎学講座
                    - Current favorite kanji: 晴れ 芝生 -

-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".