removed redundant, and no longer valid, email address
[lcore.git] / unixstuff.inc
index f8c73967a7cd99f946929d96833632a7104afc6c..89c96f2ce84c6615939eb2b4e6779d9668d581e1 100755 (executable)
@@ -8,6 +8,21 @@
       linux.dup(original,result);\r
     end;\r
     {$define gettimeofdaysec := gettimeofday}\r
+    const\r
+      IPPROTO_UDP=17;\r
+      IPPROTO_ICMP=1;\r
+    function ntohs(invalue:word):word;inline;\r
+    var\r
+      invaluebytes : array[0..1] of byte absolute invalue;\r
+      resultbytes : array[0..1] of byte absolute result;\r
+    begin\r
+      {$ifdef endian_little}\r
+       resultbytes[0] := invaluebytes[1];\r
+       resultbytes[1] := invaluebytes[0];\r
+      {$else}\r
+       result := invalue;\r
+      {$endif}\r
+    end;  \r
   {$else}\r
     \r
     {$define sigprocmask := fpsigprocmask}\r
        end;\r
       {$endif}\r
     {$endif}\r
+    {$ifdef ver2_0}\r
+      const\r
+        IPPROTO_UDP=17;\r
+        IPPROTO_ICMP=1;\r
+    {$endif}\r
+    {$ifdef ver1_9}\r
+      const\r
+        IPPROTO_UDP=17;\r
+        IPPROTO_ICMP=1;\r
+      function ntohs(invalue:word):word;inline;\r
+      var\r
+        invaluebytes : array[0..1] of byte absolute invalue;\r
+       resultbytes : array[0..1] of byte absolute result;\r
+      begin\r
+        {$ifdef endian_little}\r
+         resultbytes[0] := invaluebytes[1];\r
+         resultbytes[1] := invaluebytes[0];\r
+       {$else}\r
+         result := invalue;\r
+       {$endif}\r
+      end;\r
+    {$endif}\r
     procedure gettimeofday(var tv:ttimeval);inline;\r
     begin\r
       fpgettimeofday(@tv,nil);    \r