Re: beep in Windows XP x64



On Mon, 12 Jan 2009 20:21:20 -0700, "James Van Buskirk"
<not_valid@xxxxxxxxxxx> wrote:

I'll bet money on that! IIRC his system and gfortran is 64 bits.

Yes. Also the subject line gives it away. Unfortunately, although
it would likely take a one-line fix to make gfortran work like g95
does on 32-bit Windows, where one can write:

function MessageBeep(uType) bind(C,name='MessageBeep@4')

in gfortran one gets the error message:

Invalid C name in NAME= specifier at (1)

Why can't that be fixed simply by continuing rather than checking
for validity?

I had missed the x64 in the subject line, but the OP's wanting CVF as well
meant that IA-32 issues were still valid.

I would not expect adding @4 to work in the NAME= specifier. This is to give
the name as it would be written in C, not the fully decorated name (which also
has a leading underscore). The compiler is expected to add any decoration
that the "companion C processor" would. Even if you succeeded here, you also
need to get the compiler to use STDCALL semantics so that the stack doesn't
get popped twice.

Given that the default behavior (in absence of /Gm, etc.) of C compilers on
IA-32 Windows is to use the C mechanism, there is no standard-conforming way
to specify STDCALL and you'll need to resort to extensions.

I'll comment that writing CHAR(7) (or ACHAR(7) works only if you've got a
console application, whereas calling MessageBeep will work for any application
type.
--
Steve Lionel
Developer Products Division
Intel Corporation
Nashua, NH

For email address, replace "invalid" with "com"

User communities for Intel Software Development Products
http://software.intel.com/en-us/forums/
Intel Fortran Support
http://support.intel.com/support/performancetools/fortran
My Fortran blog
http://www.intel.com/software/drfortran
.