Print this page
make: unifdef SUN5_0 (defined)

@@ -44,21 +44,17 @@
 #include <errno.h>              /* errno */
 #include <fcntl.h>              /* open() */
 #include <mk/defs.h>
 #include <mksh/misc.h>          /* retmem_mb() */
 
-#if defined(SUN5_0) || defined(HP_UX) || defined(linux)
 struct ranlib {
         union {
                 off_t   ran_strx;       /* string table index of */
                 char    *ran_name;      /* symbol defined by */
         }       ran_un;
         off_t   ran_off;                /* library member at this offset */
 };
-#else
-#include <ranlib.h>
-#endif
 
 #if defined(linux)
 #include <ctype.h>              /* isspace */
 #else
 #include <unistd.h>             /* close() */

@@ -286,34 +282,10 @@
         if ((fd < 0) || ((arp->fd = fdopen(fd, "r")) == NULL)) {
                 return failed;
         }
         (void) fcntl(fileno(arp->fd), F_SETFD, 1);
 
-#if !defined(SUN5_0) && !defined(linux) //XXX
-        /* Read enough of the archive to distinguish between the formats */
-        if (fread(mag_5, AR_5_MAGIC_LENGTH, 1, arp->fd) != 1) {
-                return failed;
-        }
-        if (IS_EQUALN(mag_5, AR_5_MAGIC, AR_5_MAGIC_LENGTH)) {
-                arp->type = AR_5;
-                /* Must read in header to set necessary info */
-                if (fseek(arp->fd, 0L, 0) != 0 ||
-                    fread((char *) &arp->arh_5, sizeof (Arh_5), 1, arp->fd) !=
-                                                                        1) {
-                        return failed;
-                }
-                arp->sym_begin = ftell(arp->fd);
-                arp->num_symbols = sgetl(arp->arh_5.ar_syms);
-                arp->first_ar_mem = arp->sym_begin +
-                                        sizeof (Ars_5) * arp->num_symbols;
-                arp->sym_size = 0L;
-                return succeeded;
-        }
-        if (fseek(arp->fd, 0L, 0) != 0) {
-                return failed;
-        }
-#endif
         if (fread(mag_port, AR_PORT_MAGIC_LENGTH, 1, arp->fd) != 1) {
                 return failed;
         }
         if (IS_EQUALN(mag_port, AR_PORT_MAGIC, AR_PORT_MAGIC_LENGTH)) {
                 arp->type = AR_PORT;

@@ -342,27 +314,16 @@
                  * Do we have a symbol table? A symbol table is always
                  * the first member in an archive. In 4.1.x it has the 
                  * name __.SYMDEF, in SVr4, it has the name "/        "
                  */
 /*
-#ifdef SUN5_0
-                MBSTOWCS(wcs_buffer, NOCATGETS("/               "));
-                if (IS_WEQUALN(arp->ar_port.ar_name, wcs_buffer, 16)) {
-#else
-                MBSTOWCS(wcs_buffer, NOCATGETS("__.SYMDEF       "));
+                MBSTOWCS(wcs_buffer, "/               ");
                 if (IS_WEQUALN(arp->ar_port.ar_name, wcs_buffer, 16)) {
-#endif
  */
-#if defined(SUN5_0) || defined(HP_UX) || defined(linux)
                 if (IS_EQUALN(arp->ar_port.ar_name,
                               NOCATGETS("/               "),
                               16)) {
-#else
-                if (IS_EQUALN(arp->ar_port.ar_name,
-                              NOCATGETS("__.SYMDEF       "),
-                              16)) {
-#endif
                         if (sscanf(arp->ar_port.ar_size,
                                    "%ld",
                                    &arp->sym_size) != 1) {
                                 return failed;
                         }

@@ -414,15 +375,11 @@
  *                              with names > 15 characters long
  *
  *      Global variables used:
  */
 static Boolean
-#if defined(SUN5_0) || defined(linux) //XXX
 read_archive_dir(register Ar *arp, Name library, char **long_names_table)
-#else
-read_archive_dir(register Ar *arp, Name library, char **)
-#endif
 {
         wchar_t                 *name_string;
         wchar_t                 *member_string;
         register long           len;
         register wchar_t        *p;

@@ -430,21 +387,19 @@
         register Name           name;
         Property                member;
         long                    ptr;
         long                    date;
 
-#if defined(SUN5_0) || defined(linux) //XXX
         int                     offset;
 
         /*
          * If any of the members has a name > 15 chars,
          * it will be found here.
          */
         if (process_long_names_member(arp, long_names_table, library->string_mb) == failed) {
                 return failed;
         }
-#endif
         name_string = ALLOC_WC((int) (library->hash.length +
                                       (int) ar_member_name_len * 2));
         (void) mbstowcs(name_string, library->string_mb, (int) library->hash.length);
         member_string = name_string + library->hash.length;
         *member_string++ = (int) parenleft_char;

@@ -516,11 +471,10 @@
                                 catgets(catd, 1, 28, "Read error in archive `%s': invalid archive file member header at 0x%x"),
                                 library->string_mb,
                                 ftell(arp->fd)
                             );
                     }
-#if defined(SUN5_0) || defined(linux) //XXX
                     /* If it's a long name, retrieve it from long name table */
                     if (arp->ar_port.ar_name[0] == '/') {
                             /*
                              * "len" is used for hashing the string.
                              * We're using "ar_member_name_len" instead of

@@ -535,14 +489,10 @@
                             q = *long_names_table + offset;
                     } else {
                             q = arp->ar_port.ar_name;   
                             len = sizeof arp->ar_port.ar_name;
                     }
-#else
-                    q = arp->ar_port.ar_name;   
-                    len = sizeof arp->ar_port.ar_name;
-#endif
                     
                     for (p = member_string;
                          (len > 0) &&
                          (*q != (int) nul_char) &&
                          !isspace(*q) &&

@@ -782,11 +732,10 @@
                                            &date) != 1) {
                                         fatal(catgets(catd, 1, 9, "Bad date field for member `%s' in archive `%s'"),
                                               arp->ar_port.ar_name,
                                               target->string_mb);
                                 }
-#if defined(SUN5_0) || defined(linux) //XXX
                     /* If it's a long name, retrieve it from long name table */
                     if (arp->ar_port.ar_name[0] == '/') {
                             sscanf(arp->ar_port.ar_name + 1,
                                    "%ld",
                                    &offset);

@@ -794,13 +743,10 @@
                             hp = *long_names_table + offset;
                     } else {
                             len = sizeof arp->ar_port.ar_name;
                             hp = arp->ar_port.ar_name;  
                     }
-#else
-                    hp = arp->ar_port.ar_name;  
-#endif
                                 ap = member_string;
                                 while (*hp &&
                                        (*hp != (int) slash_char) &&
                                        (ap < &member_string[len])) {
                                         MBTOWC(ap, hp);