X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/82d4e52fba54be50d719f6185ec381f2dc87fc6c..0ac6b47e810e6efaebcdbf3075b633e9b4109341:/unixstuff.inc diff --git a/unixstuff.inc b/unixstuff.inc index f8c7396..89c96f2 100755 --- a/unixstuff.inc +++ b/unixstuff.inc @@ -8,6 +8,21 @@ linux.dup(original,result); end; {$define gettimeofdaysec := gettimeofday} + const + IPPROTO_UDP=17; + IPPROTO_ICMP=1; + function ntohs(invalue:word):word;inline; + var + invaluebytes : array[0..1] of byte absolute invalue; + resultbytes : array[0..1] of byte absolute result; + begin + {$ifdef endian_little} + resultbytes[0] := invaluebytes[1]; + resultbytes[1] := invaluebytes[0]; + {$else} + result := invalue; + {$endif} + end; {$else} {$define sigprocmask := fpsigprocmask} @@ -37,6 +52,28 @@ end; {$endif} {$endif} + {$ifdef ver2_0} + const + IPPROTO_UDP=17; + IPPROTO_ICMP=1; + {$endif} + {$ifdef ver1_9} + const + IPPROTO_UDP=17; + IPPROTO_ICMP=1; + function ntohs(invalue:word):word;inline; + var + invaluebytes : array[0..1] of byte absolute invalue; + resultbytes : array[0..1] of byte absolute result; + begin + {$ifdef endian_little} + resultbytes[0] := invaluebytes[1]; + resultbytes[1] := invaluebytes[0]; + {$else} + result := invalue; + {$endif} + end; + {$endif} procedure gettimeofday(var tv:ttimeval);inline; begin fpgettimeofday(@tv,nil);