1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-01 13:41:34 +00:00

Inline ntohs/htons as a macro if -i is passed

This commit is contained in:
Colin Leroy-Mira 2023-09-07 21:00:30 +02:00
parent a90aa57510
commit cbc5603d63

View File

@ -31,8 +31,22 @@
#ifndef _ARPA_INET_H
#define _ARPA_INET_H
#ifndef __OPT_i__
int __fastcall__ ntohs (int val);
int __fastcall__ htons (int val);
#else
#define ntohs(x) \
( \
__AX__=(x), \
asm("sta tmp1"), \
asm("txa"), \
asm("ldx tmp1"), \
__AX__ \
)
#define htons(x) ntohs(x)
#endif
long __fastcall__ ntohl (long val);
long __fastcall__ htonl (long val);