]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
fixinc.svr4: Fix <arpa/inet.h> by deleting protos for htons and ntohs.
authorRobert Lipe <robertlipe@usa.net>
Fri, 2 Jul 1999 00:40:24 +0000 (18:40 -0600)
committerJeff Law <law@gcc.gnu.org>
Fri, 2 Jul 1999 00:40:24 +0000 (18:40 -0600)
P
        * fixinc.svr4: Fix <arpa/inet.h> by deleting protos for htons and
        ntohs.

From-SVN: r27917

gcc/fixinc/fixinc.svr4

index 30aa67965498792a8b5291a9f24a8f2bb8097f54..fbec4bc4abbacbb9a05a391852d40ca21aa8be2e 100755 (executable)
@@ -1570,6 +1570,37 @@ if [ \! -z "$file_to_fix" ]; then
   rm -f /tmp/$base
 fi
 
+# If arpa/inet.h prototypes are incompatible with the ones we just
+# installed in <sys/byteorder.h>, just remove the protos.
+set -x
+file=arpa/inet.h
+base=`basename $file`
+if [ -r ${LIB}/$file ]; then
+  file_to_fix=${LIB}/$file
+else
+  if [ -r ${INPUT}/$file ]; then
+    file_to_fix=${INPUT}/$file
+  else
+    file_to_fix=""
+  fi
+fi
+if [ \! -z "$file_to_fix" ]; then
+  echo Checking $file_to_fix
+  sed -e '/^extern.*htons.*(in_port_t)/d' \
+      -e '/^extern.*ntohs.*(in_port_t)/d' \
+  $file_to_fix > /tmp/$base
+  if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
+    true
+  else
+    echo Fixed $file_to_fix
+    mkdir -p $LIB/`dirname $file`
+    rm -f ${LIB}/$file
+    cp /tmp/$base ${LIB}/$file
+    chmod a+r ${LIB}/$file
+  fi
+  rm -f /tmp/$base
+fi
+
 echo 'Removing unneeded directories:'
 cd $LIB
 files=`find . -type d \! -name '.' -print | sort -r`