the ms-dos version runs just fine under linux dosemu (and slightly
slower under wine) wine. the PE32 version also works under wine.
here's a patch to make it compile and work the same under linux.
(it should probably work slightly differently under linux.)
I have tried to break as few rules as possible without massive rewrites.
Also I haven't implemented any of the clipboard stuff, so that stuff
is all jut stubs.
$ diff ASC.C ASC.c
308c308,312
<
---
#ifdef __unix__
#include <strings.h>
#define _strnicmp(a,b,n) strncasecmp(a,b,n)
#else
#endif 326a331,347
#ifndef __max
# define max(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a > _b ? _a : _b; })
#else
# define max(a,b) __max(a,b)
#endif
#ifndef __min
# define min(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a <= _b ? _a : _b; })
#else
# define min(a,b) __min(a,b)
#endif 569a591
#ifndef __unix__ 591a614,619
#else
auto const char *p=strrchr(s,'/');
p = p ? p + 1 : s ;
return strdup(p);
#endif
603a632
#ifndef __unix__ 623a653,672
#else
auto char *r,*p,*in=strdup(fdir);
auto char *n=strrchr(in,'/'); // last slash
auto char *e=strchr(n?n:in,'.'); // first
auto const char *rn,*re;
p=in;
n=strrchr(in,'/'); // last slash
if (*n){ *n=0; ++n; }else { n=p; p=".";};
e=strchr(n,'.'); // first dot
if (*e){ *e=0; ++e; } else e="";
if (fname) rn=fname ; else rn=n;
if (fext) re=fext ; else re=e;
r=malloc(strlen(p)+strlen(rn)+strlen(re)+3);
sprintf(r,"%s/%s.%s",p,rn,re);
return r;
#endif
806,809c855,858
< *xmin= __min( __min( *xmin, x1 ), x2 );
< *xmax= __max( __max( *xmax, x1 ), x2 );
< *ymin= __min( __min( *ymin, y1 ), y2 );
< *ymax= __max( __max( *ymax, y1 ), y2 );
---
*xmin= min( min( *xmin, x1 ), x2 );
*xmax= max( max( *xmax, x1 ), x2 );
*ymin= min( min( *ymin, y1 ), y2 );
*ymax= max( max( *ymax, y1 ), y2 );
824,827c873,876
< *xmin= __min( *xmin, x );
< *xmax= __max( *xmax, x );
< *ymin= __min( *ymin, y );
< *ymax= __max( *ymax, y );
---
*xmin= min( *xmin, x );
*xmax= max( *xmax, x );
*ymin= min( *ymin, y );
*ymax= max( *ymax, y );
858,861c907,910
< *xmin= __min( *xmin, x );
< *xmax= __max( *xmax, x );
< *ymin= __min( *ymin, y );
< *ymax= __max( *ymax, y );
---
*xmin= min( *xmin, x );
*xmax= max( *xmax, x );
*ymin= min( *ymin, y );
*ymax= max( *ymax, y );
880,883c929,932
< *xmin= __min( *xmin, x );
< *xmax= __max( *xmax, x );
< *ymin= __min( *ymin, y );
< *ymax= __max( *ymax, y );
---
*xmin= min( *xmin, x );
*xmax= max( *xmax, x );
*ymin= min( *ymin, y );
*ymax= max( *ymax, y );
900,903c949,952
< *xmin= __min( __min( *xmin, ulx ), lrx );
< *xmax= __max( __max( *xmax, ulx ), lrx );
< *ymin= __min( __min( *ymin, uly ), lry );
< *ymax= __max( __max( *ymax, uly ), lry );
---