delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1996/11/05/00:09:29

From: colin AT fu DOT is DOT saga-u DOT ac DOT jp (Colin Peters)
Subject: Win32 API Headers and C++
5 Nov 1996 00:09:29 -0800 :
Sender: daemon AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199611050443.NAA04964.cygnus.gnu-win32@bird.fu.is.saga-u.ac.jp>
Original-To: gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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 - colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp
$@%3%j%s(J $@%T!<%?!<%:(J - $@:42lBg3XM}9)3XIt>pJs2J3X2J>pJs4pAC3X9V:B(J
                    - Current favorite kanji: $@@2$l(J $@<G AT 8(J -


-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019