mirror of
https://github.com/cc65/cc65.git
synced 2025-01-22 06:30:38 +00:00
Inline ntohs/htons as a macro if -i is passed
This commit is contained in:
parent
a90aa57510
commit
cbc5603d63
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user