ATSinline()

You can now use
ATS_EXTERN_DEF to define ATSextern():

#ifndef
ATS_EXTERN_DEF
#define ATSextern() extern
#else
#define ATSextern() ATS_EXTERN_DEF
#endif // #ifndef

See:

ATSstatic and ATSinline can be defined similarly.On Wednesday, October 7, 2015 at 4:44:51 PM UTC-4, Barry Schwartz wrote:

Given that, in another thread, the topic of helping the C compiler do
inlining showed up: is there a nice way to add stuff to ATSinline()?

I have to prepend stuff to the C code I generate, anyway, so what I’m
doing is this:

#if defined GNUC && !defined inline
/* Cause ATS-generated code to be inlined wherever possible. */
#define inline inline attribute ((always_inline))
#endif

But I was curious if there was a nice way to do it if one is not using
ATS to make C code that then gets processed some more.

Similarly, is there a way to put something like
attribute((flatten)) in ATSextern() or ATSstatic()?

Okay. I will use ATS… instead.On Thursday, October 8, 2015 at 3:23:39 PM UTC-4, Barry Schwartz wrote:

gmhwxi <gmh...@gmail.com <javascript:>> skribis:

You can now use
ATS_EXTERN_DEF to define ATSextern():

There is one remark I just realized I ought to make, which is that (as
I only recently came upon in the C standard) names beginning with ‘_’
followed by a capital letter are supposed to be reserved for the
compiler.

The same with names that begin with two underscores, ‘__’, followed by
a lowercase letter.

It is not uncommon to find ‘violations’ of this provision that no one
is ever going to do anything about, such as some of the names in GMP,
and a compiler that complained would be obnoxious. Nevertheless, I
have started being conscious of the ‘rule’ in my own coding. :slight_smile:
Started using more postfix ‘_’ characters and fewer prefix ones.

I see. I will drop the two underscores in the front.On Wednesday, October 7, 2015 at 4:44:51 PM UTC-4, Barry Schwartz wrote:

Given that, in another thread, the topic of helping the C compiler do
inlining showed up: is there a nice way to add stuff to ATSinline()?

I have to prepend stuff to the C code I generate, anyway, so what I’m
doing is this:

#if defined GNUC && !defined inline
/* Cause ATS-generated code to be inlined wherever possible. */
#define inline inline attribute ((always_inline))
#endif

But I was curious if there was a nice way to do it if one is not using
ATS to make C code that then gets processed some more.

Similarly, is there a way to put something like
attribute((flatten)) in ATSextern() or ATSstatic()?