HaikuPorts
  • Login
  • Preferences
  • Help/Guide
  • Wiki
  • Timeline
  • Roadmap
  • View Tickets
  • Search
  • Port Log
  • Blog

Context Navigation

  • Back to app-arch/arc/5.21o/1

app-arch/arc/5.21o/1: arc-5.21o.patch

File arc-5.21o.patch, 3.7 KB (added by thorn, 6 years ago)
  • Makefile

    diff -Naur arc-5.21o.orig/Makefile arc-5.21o/Makefile
    old new  
    3838#SYSTEM = -DBSD=1 
    3939SYSTEM = -DSYSV=1 
    4040 
    41 OPT = -O 
     41OPT = -O2 -DNEED_ALPHASORT  
    4242# For MWC 3.0 on the Atari ST, use: 
    4343#CFLAGS = -VCOMPAC -VPEEP 
    4444CFLAGS = $(OPT) $(SYSTEM) 
    4545 
    4646# GNU's gcc is very nice, if you've got it. Otherwise just cc. 
    4747#CC = cgcc -mshort -mbaserel 
    48 CC = cc 
     48#CC = cc 
    4949 
    5050# tmclock is only needed on Unix systems... 
    5151TMCLOCK = tmclock.o 
  • arcdos.c

    diff -Naur arc-5.21o.orig/arcdos.c arc-5.21o/arcdos.c
    old new  
    3333#if     BSD 
    3434#include <sys/time.h> 
    3535#else    
    36 #include <time.h>               /* Sys V. Bleah. */ 
     36#include <sys/time.h>           /* Sys V. Bleah. */ 
    3737#if     NEED_TIMEVAL 
    3838struct  timeval { 
    3939        long    tv_sec; 
  • arcmisc.c

    diff -Naur arc-5.21o.orig/arcmisc.c arc-5.21o/arcmisc.c
    old new  
    88#include "arc.h" 
    99 
    1010#include <string.h> 
     11#include <dirent.h> 
     12#include <errno.h> 
    1113#if     BSD 
    1214#include <strings.h> 
    1315#endif 
    … …  
    211213 
    212214#endif 
    213215 
     216#if UNIX 
     217 
     218#define DIRSIZ(d) (sizeof(struct dirent) + strlen(d->d_name) + 1) 
     219#define INITIAL_SIZE 30 
     220 
     221int 
     222scandir(name, dirlist, selector, sorter) 
     223        const char      *name; 
     224        struct dirent   ***dirlist; 
     225        int             (*selector)(); 
     226        int             (*sorter)(); 
     227{ 
     228        static struct dirent *E; 
     229        struct dirent   **names; 
     230        DIR             *Dp; 
     231        int             i; 
     232        int             size = INITIAL_SIZE; 
     233 
     234        if (!(names = (struct dirent **) malloc(size * sizeof names[0])) || 
     235             access(name, R_OK | X_OK) || !(Dp = opendir(name))) 
     236                return -1; 
     237 
     238        /* Read entries in the directory. */ 
     239 
     240        for (i = 0; (E = readdir(Dp)); ) 
     241                if (selector == NULL || (*selector)(E)) 
     242        { 
     243                /* User wants them all, or he wants this one. */ 
     244                if (++i >= size) 
     245                { 
     246                        size <<= 1; 
     247                        names = (struct dirent **) realloc(names, 
     248                                                size * sizeof names[0]); 
     249                        if (names == NULL) 
     250                        { 
     251                                closedir(Dp); 
     252                                free(&names); 
     253                                return(-1); 
     254                        } 
     255                } 
     256 
     257                /* Copy the entry. */ 
     258                names[i - 1] = (struct dirent *) malloc(DIRSIZ(E)); 
     259                if (names[i - 1] == NULL) 
     260                { 
     261                        closedir(Dp); 
     262                        free(&names); 
     263                        return(-1); 
     264                } 
     265                strcpy(names[i - 1]->d_name, E->d_name); 
     266        } 
     267 
     268        /* Close things off. */ 
     269        names = (struct dirent **) realloc(names, 
     270                                        (i + 1) * sizeof names[0]); 
     271        names[i] = 0; 
     272        *dirlist = names; 
     273        closedir(Dp); 
     274 
     275        /* Sort? */ 
     276        if (i && sorter) 
     277                qsort((char *)names, i, sizeof names[0], sorter); 
     278 
     279        return i; 
     280} 
     281#endif 
     282 
    214283VOID 
    215284upper(string) 
    216285        char           *string; 
    … …  
    309378        static char   **NameList; 
    310379        static char     namecopy[STRLEN], *dirname; 
    311380#if     UNIX 
    312         int             alphasort(); 
    313         int             scandir(); 
     381        //int             alphasort(); 
     382        //int             scandir(); 
    314383#endif                          /* UNIX */ 
     384 
    315385        int             fmatch(); 
    316386        static int      Nnum = 0, ii; 
    317387 

Download in other formats:

  • Original Format

Trac Powered

Powered by Trac 0.13dev-r10686
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/