ATS_PACKNAME is for names generated by the compiler, and
ATS_EXTERN_PREFIX is for external names chosen by a programmer.On Saturday, August 30, 2014 8:01:17 AM UTC-4, Artyom Shalkhakov wrote:
On Saturday, August 30, 2014 10:26:23 AM UTC+6, gmhwxi wrote:
There is also a special flag named ATS_EXTERN_PREFIX.
Say we have
#define ATS_EXTERN_PREFIX “ABCDE_”
If we do
extern fun foo(…): … = “mac#%”
then the external name of foo is ${ATS_EXTERN_PREFIX}foo. Basically, the
‘%’ here
is replaced with the string value stored in ATS_EXTERN_PREFIX.
Does this interact with ATS_PACKNAME or not? What’s the difference?
045 looks a bit too mysterious (it is translated from ‘%’).
I have now changed it to ‘ATS_EXTERN_PREFIX’. So, basically,
if ATS_EXTERN_PREFIX is undefined, its value is assumed to be ATS_EXTERN_PREFIX.On Saturday, May 9, 2015 at 7:01:46 PM UTC-4, Yannick Duchêne wrote:
Le samedi 30 août 2014 06:26:23 UTC+2, gmhwxi a écrit :
There is also a special flag named ATS_EXTERN_PREFIX.
Say we have
#define ATS_EXTERN_PREFIX “ABCDE_”
If we do
extern fun foo(…): … = “mac#%”
then the external name of foo is ${ATS_EXTERN_PREFIX}foo. Basically, the
‘%’ here
is replaced with the string value stored in ATS_EXTERN_PREFIX.
I don’t know if it’s on purpose, I noticed when there is no definition for
ATS_EXTERN_PREFIX, the name is just substituted _045_ , literally and
with no warning, while there is a warning when ATS_EXTERN_PREFIX is defined
with anything which is not a string.
There is also a special flag named ATS_EXTERN_PREFIX.
Say we have
#define ATS_EXTERN_PREFIX “ABCDE_”
If we do
extern fun foo(…): … = “mac#%”
then the external name of foo is ${ATS_EXTERN_PREFIX}foo. Basically, the
‘%’ here
is replaced with the string value stored in ATS_EXTERN_PREFIX.On Sat, Aug 30, 2014 at 12:20 AM, Shea Levy sh...@shealevy.com wrote:
Hello all,
I know declaring a function = “mac#foo” makes it treated like a macro in
C, but what does mac#% mean? e.g. in libc/SATS/alloca.sats:
fun alloca
{dummy:addr}{n:int}
(
pf: void@dummy | n: size_t (n)
) : [l:addr]
(
bytes(n) @ l, bytes(n) @ l → void@dummy | ptr(l)
) = “mac#%” // end of [alloca]
There is also a special flag named ATS_EXTERN_PREFIX.
Say we have
#define ATS_EXTERN_PREFIX “ABCDE_”
If we do
extern fun foo(…): … = “mac#%”
then the external name of foo is ${ATS_EXTERN_PREFIX}foo. Basically, the
‘%’ here
is replaced with the string value stored in ATS_EXTERN_PREFIX.
I don’t know if it’s on purpose, I noticed when there is no definition for
ATS_EXTERN_PREFIX, the name is just substituted _045_ , literally and
with no warning, while there is a warning when ATS_EXTERN_PREFIX is defined
with anything which is not a string.