|
Hi Eric,
Using '#define' should work, just make sure you define it prior to
any #include statement that might try to make use of the macro. In my
small version of the testcase I just defined it before all the #include
statements and it worked fine.
-------------------- Example ----------------------------
#define __STDC_WANT_DEC_FP__
#include <stdlib.h>
#include <stdio.h>
int main(void) {
char *dfpstring = "3.1415926This stopped it";
char *stopstring;
_Decimal64 dfp;
dfp = strtod64(dfpstring, &stopstring);
printf(" strtod = %Df\n", dfp);
return 0;
}
-------------------- End example ------------------------
Thanks,
Aaron Albertson
From: Erik Olsson <erik.eo.olsson@xxxxxxxxx>
To: "C programming iSeries / AS400" <c400-l@xxxxxxxxxxxx>
Date: 07/15/2011 10:25 AM
Subject: Re: [C400-L] strtod64 function
Sent by: c400-l-bounces+albertaa=us.ibm.com@xxxxxxxxxxxx
Thanks Aaron,
That works. Just wondering, I had previously tried to manually define
this macro simply as
#define __STDC_WANT_DEC_FP__
... but not on the CRTCMOD.
That had the effect that the conditional compilation like so
#if (__OS400_TGTVRM__ >= 610) && defined __STDC_WANT_DEC_FP__ &&
defined __IBM_DFP__
dfpstring = malloc(fldqry->len + 1 );
memcpy(dfpstring, fldqry->data, fldqry->len);
dfpstring[fldqry->len] = '\0';
record->ORDEXCRATE = strtod64(dfpstring, &stopstring);
free(dfpstring);
#endif
did happen, but still the prototype could not be found.
Is this difference between the defines working as designed?
Regards,
Erik
2011/7/15 Aaron Albertson <albertaa@xxxxxxxxxx>:
to
Hi Erik,
This isn't documented well in the manual, but the 'what' in 'what
defines this macro' is you. This is intended to give the developer some
control about whether the entry points are visible. To get the testcase
work just add DEFINE('__STDC_WANT_DEC_FP__') to your CRTCMOD compile--
command.
Thanks,
Aaron Albertson
From: Erik Olsson <erik.eo.olsson@xxxxxxxxx>
To: "C programming iSeries / AS400" <c400-l@xxxxxxxxxxxx>
Date: 07/15/2011 02:27 AM
Subject: Re: [C400-L] strtod64 function
Sent by: c400-l-bounces+albertaa=us.ibm.com@xxxxxxxxxxxx
Thanks again for the tip.
It seems like the __STDC_WANT_DEC_FP__ macro is not defined and that
this is the cause of the prototype not being found. I anyone knows
what defines this macro please let me know.
2011/7/15 Dennis Lovelady <iseries@xxxxxxxxxxxx>:
Harumph!and/or
I've been away today due to travel. You can exercise the PPSRCFILE
PPSRCSTMF parameters to write out the preprocessed source. I would nexttry
that, and then search it for the proto. Dunno... I'm grasping at strawsbeen
here. Wish I had a couple of jumper cables, 'cuz they'll latch onto
anything.
Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"The most remarkable thing about my mother is that for thirty years she
served the family nothing but leftovers. The original meal has never
found."--
-- Calvin Trillin
Hmm, wrapped conditional compiler directives around the code so it
only tries to compile if these macros are in effect. They are, and
still no prototype found.
--
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.
--
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.
--
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.