1. ver 4.0 source question
- Posted by Lnettnay Oct 15, 2008
- 1216 views
What is the difference meaning between these two conditions ?
- #if XXXX
- #if define(XXXX)
What would be the equivalent for this in the above notation ?
- #ifndef XXXX
- ???????????
2. Re: ver 4.0 source question
- Posted by ne1uno Oct 15, 2008
- 1238 views
What is the difference meaning between these two conditions ?
- #if XXXX
- #if define(XXXX)
What would be the equivalent for this in the above notation ?
- #ifndef XXXX
- ???????????
I don't 100% understand the question.
with define XXXX if !XXXX then is how it is used. exwc -D XXX some.exw also works if not XXXX then
is not currently supported, but was added as a casual feature request
3. Re: ver 4.0 source question
- Posted by bernie Oct 15, 2008
- 1237 views
What is the difference meaning between these two conditions ?
- #if XXXX
- #if define(XXXX)
What would be the equivalent for this in the above notation ?
- #ifndef XXXX
- ???????????
I don't 100% understand the question.
with define XXXX if !XXXX then is how it is used. exwc -D XXX some.exw also works if not XXXX then
is not currently supported, but was added as a casual feature request
NOTE I talking about the POUND SIGN conditionals.
4. Re: ver 4.0 source question
- Posted by ne1uno Oct 15, 2008
- 1241 views
What is the difference meaning between these two conditions ?
- #if XXXX
- #if define(XXXX)
What would be the equivalent for this in the above notation ?
- #ifndef XXXX
- ???????????
let me try that again,
with define XXXZ -- exwc -D XXXZ some.exw also works ifdef !XXXX then printf(1, " XXXX not defined or other than TRUE", {}) elsifdef XXXZ then printf(1, "XXXZ is defined TRUE", {}) elsedef printf(1, "XXXX not defined or is TRUE", {}) end ifdef
test first then post. maybe XXXZ can't happen but you get the idea. with define XXXX=20 doesn't error but seemingly doesn't exactly work
5. Re: ver 4.0 source question
- Posted by DerekParnell (admin) Oct 15, 2008
- 1209 views
What is the difference meaning between these two conditions ?
- #if XXXX
- #if define(XXXX)
That looks like C programming language syntax and I don't think there is a difference. They both cause the compiler to check if 'XXXX' has been defined. I assume you know that Euphoria has a different syntax for this concept.
ifdef XXXX then . . . end ifdef
What would be the equivalent for this in the above notation ?
- #ifndef XXXX
- ???????????
Are you asking what is the C notation for this or the Euphoria notation? In Euphoria one would write ...
ifdef !XXXX then . . . end ifdef
6. Re: ver 4.0 source question
- Posted by DerekParnell (admin) Oct 15, 2008
- 1225 views
with define XXXX=20 doesn't error but seemingly doesn't exactly work
I think that "with define XXXX=20" should error, because the concept in Euphoria is that either something is defined or it is not. We are not supposed to be able to assign a specific value to these 'words'. Maybe this is in preparation for a feature later on in v4.1?
7. Re: ver 4.0 source question
- Posted by mattlewis (admin) Oct 15, 2008
- 1222 views
I assume you're asking about the C code.
What is the difference meaning between these two conditions ?
- #if XXXX
- #if define(XXXX)
The first instance requires the the macro be both defined, and evaluate to something other than 0.
What would be the equivalent for this in the above notation ?
- #ifndef XXXX
- ???????????
I think the best analog would be:
#if !XXXXThis requires the macro to evaluate to 0.
Matt
8. Re: ver 4.0 source question
- Posted by bernie Oct 15, 2008
- 1184 views
What is the difference meaning between these two conditions ?
- #if XXXX
- #if define(XXXX)
That looks like C programming language syntax and I don't think there is a difference. They both cause the compiler to check if 'XXXX' has been defined. I assume you know that Euphoria has a different syntax for this concept.
ifdef XXXX then . . . end ifdef
What would be the equivalent for this in the above notation ?
- #ifndef XXXX
- ???????????
Are you asking what is the C notation for this or the Euphoria notation? In Euphoria one would write ...
ifdef !XXXX then . . . end ifdef
Hi Derek:
Yes I'am talking the "C" notation in the source code.
What is confusing me is that different developers are using different forms of the conditional notation.
Are we sure that this is supported on any compiler. I kind of thought that #if, #ifndef and etc. is generic but I'am not sure where the #if define(XXXX) is coming from. I can't find any information in the Watcom hlp files about it. I'am trying to understand the logic for the compiler when using it for WIN98 because the conditionals don't make sense to me.
Bernie
9. Re: ver 4.0 source question
- Posted by ne1uno Oct 15, 2008
- 1231 views
Are we sure that this is supported on any compiler. I kind of thought that #if, #ifndef and etc. is generic but I'am not sure where the #if define(XXXX) is coming from.
define() should be defined() is it messpelled in the source somewhere? could be a latent bug.
ex:
#if !defined(__WATCOMC__) && (WINVER > 0x0400) #endif
10. Re: ver 4.0 source question
- Posted by bernie Oct 15, 2008
- 1191 views
Are we sure that this is supported on any compiler. I kind of thought that #if, #ifndef and etc. is generic but I'am not sure where the #if define(XXXX) is coming from.
define() should be defined() is it messpelled in the source somewhere? could be a latent bug.
ex:
#if !defined(__WATCOMC__) && (WINVER > 0x0400) #endif
No I miss spelled it in my Post.
11. Re: ver 4.0 source question
- Posted by mattlewis (admin) Oct 15, 2008
- 1234 views
Yes I'am talking the "C" notation in the source code.
What is confusing me is that different developers are using different forms of the conditional notation.
Are we sure that this is supported on any compiler. I kind of thought that #if, #ifndef and etc. is generic but I'am not sure where the #if define(XXXX) is coming from. I can't find any information in the Watcom hlp files about it. I'am trying to understand the logic for the compiler when using it for WIN98 because the conditionals don't make sense to me.
These are part of the C99 Standard (warning: PDF). In particular, take a look starting at page 148 (160 in my PDF viewer).
ifdef is useful for a simple guard, but the defined syntax is useful for more complex conditions:
#if defined( GUI ) && USE_GTK
Matt
12. Re: ver 4.0 source question
- Posted by bernie Oct 15, 2008
- 1233 views
I assume you're asking about the C code.
What is the difference meaning between these two conditions ?
- #if XXXX
- #if define(XXXX)
The first instance requires the the macro be both defined, and evaluate to something other than 0.
What would be the equivalent for this in the above notation ?
- #ifndef XXXX
- ???????????
I think the best analog would be:
#if !XXXXThis requires the macro to evaluate to 0.
Matt
Thanks Matt and etal that is what I needed to know.
PS: Matt: If you do a check-in of any SVN source after ver 1991.
This is where the compile fails; maybe a file is missing.
--------------------------------------------------------- mkdir dosbkobj\back wmake -f makefile.wat .\intobj\main-.c EX="c:\eu1\bin"\exwc.exe EU_TARGE T=int. OBJDIR=intobj DEBUG= MANAGED_MEM=1 Open Watcom Make Version 1.6 Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved. Source code is available under the Sybase Open Watcom Public License. See http://www.openwatcom.org/ for details. c:\eu1\bin\exwc.exe -i ..\include revget.ex cd .\intobj del *.c Could Not Find C:\1205\source\intobj\*.c Error(E42): Last command making (.\intobj\main-.c) returned a bad status Error(E02): Make execution terminated Error(E42): Last command making (interpreter) returned a bad status Error(E02): Make execution terminated Error(E42): Last command making (winall) returned a bad status Error(E02): Make execution terminated Error(E42): Last command making (all) returned a bad status Error(E02): Make execution terminated ---------------------------------------------------------------------
13. Re: ver 4.0 source question
- Posted by mattlewis (admin) Oct 15, 2008
- 1215 views
- Last edited Oct 16, 2008
PS: Matt: If you do a check-in of any SVN source after ver 1991.
This is where the compile fails; maybe a file is missing.
del *.c
The problem is that apparently the del command returns a bad status if it couldn't find anything to delete. Which causes the make process to stop. Try adding a '-' in front of the del command:
-del *.cThat tells wmake to ignore non-zero exit codes. When I get to a windows machine, I'll test it and commit the change (unless someone else beats me to it).
Matt