This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Broken C code


Stephen Davies wrote:

> Hello.
>
> I have managed to break my ability to compile a number of C programs with gcc
> 2.7B19 under cygwin B19.1.
>
> In September 1999, all of these programs compiled successfully on the same
> machine with the same cygwin environment.
>
> Now, all of the programs involved fail to compile with the same error messages
> and I haven't a clue as to why.
>
> In all cases, the following code is included from a vendor-specific set of
> headers:
>
> typedef  IDI_ULONG  (__attribute__((__stdcall__))  *  OPI_DELETE_CALLBACK )  (OPI_CONID, OPI_FILEID);^M
> __declspec(dllexport)   IDI_USHORT  __attribute__((__stdcall__))   OpiMakeConnection( OPI_PCONID pConID );^M
>
> (This is just two of many similar lines)
>
> This produces the following compiler message:
>
> ../include/opiob.h: In function '__declspec':
> In file included from ../include/opi.h:283,
>                        from cic.h:1,
>                        from getpk.c:1
> ../include/opiob.h:141 parse error before '__declspec'
> ../include/opiob.h:140 declaration for parameter 'OpiMakeConnection' but no
> such parameter
>
> followed by a whole bundle of similar errors.
>
> Can anyone please explain to me what I have done/not done to cause this
> misinterpretation of the __declspec(dllexport) syntax?
>
> Cheers and thanks,
> Stephen Davies
>
> --
> ========================================================================
> Stephen Davies Consulting                             scldad@sdc.com.au
> Adelaide, South Australia.                        Voice: 08-8177 1595
> Computing & Network solutions.                Fax: 08-8177 0133
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com

  I believe you have a text-mode vs. binary-mode problem.  Your files have
^M^J at end of each line but only ^J is needed by the compiler this leaves
an invalid ^M character at the beginning of lines which the compiler can't
parse.
  I suggest you have mounted the source drive in binary mode and you should
mount in in text mode instead.

Warm Regards,

Terry Lincoln


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]