| delorie.com/archives/browse.cgi | search |
| X-Authentication-Warning: | delorie.com: mail set sender to djgpp-workers-bounces using -f |
| From: | <ams AT ludd DOT luth DOT se> |
| Message-Id: | <200311050038.hA50cEoS001039@speedy.ludd.luth.se> |
| Subject: | Re: C99 Functions Under Development and Checkout |
| In-Reply-To: | <3FA80338.C83BB2BD@phekda.freeserve.co.uk> "from Richard Dawe at |
| Nov 4, 2003 07:51:20 pm" | |
| To: | djgpp-workers AT delorie DOT com |
| Date: | Wed, 5 Nov 2003 01:38:14 +0100 (CET) |
| X-Mailer: | ELM [version 2.4ME+ PL78 (25)] |
| MIME-Version: | 1.0 |
| X-MailScanner: | Found to be clean |
| Reply-To: | djgpp-workers AT delorie DOT com |
| Errors-To: | nobody AT delorie DOT com |
| X-Mailing-List: | djgpp-workers AT delorie DOT com |
| X-Unsubscribes-To: | listserv AT delorie DOT com |
According to Richard Dawe:
> An "identifier with external linkage" in this case would be a global variable.
>
> I guess the two options you have are:
>
> (1) In a new source module define a library internal function to return the
> error-handling status. E.g.:
>
> #include <math.h>
>
> static const int __math_errhandling = MATH_ERRNO|MATH_ERREXCEPT;
>
> int __get_math_errhandling (void)
> {
> return __math_errhandling;
> }
>
> Then in <math.h> define the macro to call the function:
>
> extern int __get_math_errhandling(void);
> #define math_errhandling (__get_math_errhandling());
>
> (2) Just define the macro:
>
> #define math_errhandling (MATH_ERRNO|MATH_ERREXCEPT)
(3) just define the variable:
<math.h>:
extern int math_errhandling; /* Perhaps with const too. */
some/path/math_err.c:
int math_errhandling = SOME_VALUE;
?
Right,
MartinS
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |