X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/ed1d49cbe548d9fb26a50f1b2381b693c3c01790..968c333d05db5d5ecf3599f8e304c67e64f21159:/dnssync.pas diff --git a/dnssync.pas b/dnssync.pas index f6b0281..7dedcca 100644 --- a/dnssync.pas +++ b/dnssync.pas @@ -13,7 +13,7 @@ interface uses dnscore, binipstuff, - {$ifdef win32} + {$ifdef mswindows} winsock, windows, {$else} @@ -60,12 +60,12 @@ const implementation -{$ifdef win32} +{$ifdef mswindows} uses dnswin; {$endif} -{$ifndef win32} +{$ifndef mswindows} {$define syncdnscore} {$endif} @@ -76,7 +76,7 @@ type tdnsstatearr=array[0..numsock-1] of tdnsstate; {$ifdef syncdnscore} -{$ifdef win32} +{$ifdef mswindows} const winsocket = 'wsock32.dll'; function sendto(s: TSocket; const Buf; len, flags: Integer; var addrto: TinetSockAddrV; tolen: Integer): Integer; stdcall; external winsocket name 'sendto'; @@ -87,7 +87,7 @@ type tdnsstatearr=array[0..numsock-1] of tdnsstate; function getts:integer; -{$ifdef win32} +{$ifdef mswindows} begin result := GetTickCount and tsmask; {$else} @@ -117,7 +117,7 @@ var a,b:integer; Src : TInetSockAddrV; - Srcx : {$ifdef win32}sockaddr_in{$else}TInetSockAddrV{$endif} absolute Src; + Srcx : {$ifdef mswindows}sockaddr_in{$else}TInetSockAddrV{$endif} absolute Src; SrcLen : Integer; fromip:tbinip; fromport:ansistring; @@ -153,12 +153,12 @@ begin makeinaddrv(biniptemp,inttostr( porttemp ),inaddrtemp); fd[a] := Socket(biniptemp.family,SOCK_DGRAM,0); - bindresult := {$ifdef win32}Not{$endif} Bind(fd[a],inAddrtemp,inaddrsize(inaddrtemp)); + bindresult := {$ifdef mswindows}Not{$endif} Bind(fd[a],inAddrtemp,inaddrsize(inaddrtemp)); dec(retrycount); until (retrycount <= 0) or (bindresult); If (not bindresult) Then begin - {$ifdef win32} + {$ifdef mswindows} raise Exception.create('unable to bind '+inttostr(WSAGetLastError)); {$else} raise Exception.create('unable to bind '+inttostr(socketError)); @@ -186,7 +186,7 @@ begin ip := getcurrentsystemnameserverbin(id); - {$ifdef ipv6}{$ifdef win32} + {$ifdef ipv6}{$ifdef mswindows} if toaddr[socknum].family = AF_INET6 then if (useaf = 0) then useaf := useaf_preferv6; {$endif}{$endif} @@ -327,7 +327,7 @@ begin exit; //it was an IP address, no need for dns end; - {$ifdef win32} + {$ifdef mswindows} if usewindns then begin if (useaf = useaf_v4) then a := af_inet else if (useaf = useaf_v6) then a := af_inet6 else a := 0; result := winforwardlookuplist(name,a,dummy); @@ -398,7 +398,7 @@ var numsockused:integer; state:tdnsstatearr; begin - {$ifdef win32} + {$ifdef mswindows} if usewindns then begin result := winreverselookup(ip,dummy); exit; @@ -412,7 +412,7 @@ begin {$endif} end; -{$ifdef win32} +{$ifdef mswindows} var wsadata : twsadata;