Csound Csound-dev Csound-tekno Search About

[CSOUND-DEV:3613] Re: -mno-cygwin and csound4 on win2k, autoconf

Date2003-12-03 01:51
From"Michael Gogins"
Subject[CSOUND-DEV:3613] Re: -mno-cygwin and csound4 on win2k, autoconf
You can use __CYGWIN__ to identify Cygwin (two trailing and leading
underscores), and you can use __GNUC__ to identify gcc or g++.

============================================
Michael Gogins
gogins at pipeline period com
Irreducible Productions
CsoundVST, an extended version of Csound for programming music and sound
Available at http://sourceforge.net/projects/csound/
============================================


----- Original Message ----- 
From: "steven" 
To: "Csound Developers Discussion List" 
Sent: Tuesday, December 02, 2003 6:27 PM
Subject: [CSOUND-DEV:3610] -mno-cygwin and csound4 on win2k, autoconf


> Hi all,
>
> Using -mno-cygwin with the autoconf build there is an error I get that
> holds up the build in main.c:
>
> #if defined(HAVE_FLTK) && (defined(LINUX) || defined(SGI) || defined(sol))
>     if (sig == SIGALRM) return;
> #elif defined(FLTK_GUI) && (!defined(_MSC_VER))
>     if (sig == SIGALRM) return;
> #endif
>
> I've gotten past it with:
>
> #if !defined(WIN32)
> #if defined(HAVE_FLTK) && (defined(LINUX) || defined(SGI) || defined(sol))
>     if (sig == SIGALRM) return;
> #elif defined(FLTK_GUI) && (!defined(_MSC_VER))
>     if (sig == SIGALRM) return;
> #endif
> #endif
>
> but am not quite sure this is best.
>
> The reason the first set of #ifdef's doesn't compile with -mno-cygwin is
> that I don't believe there is a SIGALRM native to windows.  If using
> Cywin but not using -mno-cygwin, cygwin has emulation for SIGALRM, so if
> WIN32 is defined but cygwin is being used, then SIGALRM won't be
> compiled in at this section if using the second set of #ifdef's.   I'm
> not confident I know exactly what is the best way to reorder this stuff,
> so any help on this is greatly appreciated.
>
> thanks,
> steven
>

Date2003-12-03 03:08
Fromstevenyi
Subject[CSOUND-DEV:3614] Re: -mno-cygwin and csound4 on win2k, autoconf
Hi Michael,

Thanks very much for the information! 

I think I just realized a possible simpler solution:

#if !defined(SIGALRM) 
	/* do nothing */
#elif...

But that's assuming SIGALRM is defined as a preprocessor macro on all
systems that use SIGALRM (that's the case on Linux and OSX at least, and
if I understand correctly, anything POSIX-based).  This seems like a
pretty good solution to me that will catch any possible compiling errors
for this section code.

I'll give it a go tomorrow, and if it works in the various cases I can
try I'll commit it as a bug-fix to csound4. 

Thanks!
steven



On Tue, 2003-12-02 at 17:51, Michael Gogins wrote:
> You can use __CYGWIN__ to identify Cygwin (two trailing and leading
> underscores), and you can use __GNUC__ to identify gcc or g++.

Date2003-12-03 03:46
FromRobert McNulty Junior
Subject[CSOUND-DEV:3615] Re: -mno-cygwin and csound4 on win2k, autoconf
Steve, your plan worked under Cygwin.
It's compiling the rest of it now.
I'm probably going to have to change widgets.cpp again to match the system.
This time, I'm using __CYGWIN__, as thats defined in the compiler.
Bobby

stevenyi wrote:

>Hi Michael,
>
>Thanks very much for the information! 
>
>I think I just realized a possible simpler solution:
>
>#if !defined(SIGALRM) 
>	/* do nothing */
>#elif...
>
>But that's assuming SIGALRM is defined as a preprocessor macro on all
>systems that use SIGALRM (that's the case on Linux and OSX at least, and
>if I understand correctly, anything POSIX-based).  This seems like a
>pretty good solution to me that will catch any possible compiling errors
>for this section code.
>
>I'll give it a go tomorrow, and if it works in the various cases I can
>try I'll commit it as a bug-fix to csound4. 
>
>Thanks!
>steven
>
>
>
>On Tue, 2003-12-02 at 17:51, Michael Gogins wrote:
>  
>
>>You can use __CYGWIN__ to identify Cygwin (two trailing and leading
>>underscores), and you can use __GNUC__ to identify gcc or g++.
>>    
>>
>
>
>  
>