Skip to content

Commit

Permalink
external libs: updates to libmikmod from mainstream, rebuilt.
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Dec 8, 2019
1 parent 167f29d commit c72476f
Show file tree
Hide file tree
Showing 27 changed files with 107 additions and 27 deletions.
Binary file modified VisualC/external/lib/x64/libmikmod-2.dll
Binary file not shown.
Binary file modified VisualC/external/lib/x86/libmikmod-2.dll
Binary file not shown.
Binary file modified Xcode/Frameworks/mikmod.framework/Versions/A/mikmod
Binary file not shown.
1 change: 1 addition & 0 deletions external/libmikmod/Makefile.in
Expand Up @@ -332,6 +332,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
Expand Down
26 changes: 19 additions & 7 deletions external/libmikmod/configure
Expand Up @@ -743,6 +743,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
Expand Down Expand Up @@ -853,6 +854,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
Expand Down Expand Up @@ -1105,6 +1107,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;

-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;

-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
Expand Down Expand Up @@ -1242,7 +1253,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
Expand Down Expand Up @@ -1395,6 +1406,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
Expand Down Expand Up @@ -9783,7 +9795,7 @@ _LT_EOF
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes=yes
file_list_spec='@'
;;
Expand Down Expand Up @@ -10638,7 +10650,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes=yes
file_list_spec='@'
;;
Expand Down Expand Up @@ -13083,16 +13095,16 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
# Try to guess by grepping values from an object file.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
short int ascii_mm[] =
unsigned short int ascii_mm[] =
{ 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
short int ascii_ii[] =
unsigned short int ascii_ii[] =
{ 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
int use_ascii (int i) {
return ascii_mm[i] + ascii_ii[i];
}
short int ebcdic_ii[] =
unsigned short int ebcdic_ii[] =
{ 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
short int ebcdic_mm[] =
unsigned short int ebcdic_mm[] =
{ 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
int use_ebcdic (int i) {
return ebcdic_mm[i] + ebcdic_ii[i];
Expand Down
1 change: 1 addition & 0 deletions external/libmikmod/dlapi/Makefile.in
Expand Up @@ -192,6 +192,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
Expand Down
1 change: 1 addition & 0 deletions external/libmikmod/docs/Makefile.in
Expand Up @@ -237,6 +237,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
Expand Down
1 change: 1 addition & 0 deletions external/libmikmod/drivers/Makefile.in
Expand Up @@ -192,6 +192,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
Expand Down
1 change: 1 addition & 0 deletions external/libmikmod/include/Makefile.in
Expand Up @@ -225,6 +225,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
Expand Down
1 change: 1 addition & 0 deletions external/libmikmod/loaders/Makefile.in
Expand Up @@ -192,6 +192,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
Expand Down
5 changes: 5 additions & 0 deletions external/libmikmod/loaders/load_dsm.c
Expand Up @@ -285,6 +285,11 @@ static BOOL DSM_Load(BOOL curious)
for(t=0;t<mh->numord;t++) {
int order=mh->orders[t];
if(order==255) order=LAST_PATTERN;
else if (of.positions[t]>of.numpat) { /* SANITIY CHECK */
/* fprintf(stderr,"positions[%d]=%d > numpat=%d\n",t,of.positions[t],of.numpat);*/
_mm_errno = MMERR_LOADING_HEADER;
return 0;
}
of.positions[of.numpos]=order;
if(mh->orders[t]<254) of.numpos++;
}
Expand Down
7 changes: 7 additions & 0 deletions external/libmikmod/loaders/load_imf.c
Expand Up @@ -490,6 +490,13 @@ static BOOL IMF_Load(BOOL curious)
if(!AllocPositions(of.numpos)) return 0;
for(t=u=0;t<mh->ordnum;t++)
if(mh->orders[t]!=0xff) of.positions[u++]=mh->orders[t];
for(t=0;t<of.numpos;t++) {
if (of.positions[t]>of.numpat) { /* SANITIY CHECK */
/* fprintf(stderr,"position[%d]=%d > numpat=%d\n",t,of.positions[t],of.numpat);*/
_mm_errno = MMERR_LOADING_HEADER;
return 0;
}
}

/* load pattern info */
of.numtrk=of.numpat*of.numchn;
Expand Down
1 change: 1 addition & 0 deletions external/libmikmod/loaders/load_it.c
Expand Up @@ -396,6 +396,7 @@ static void LoadMidiString(MREADER* r,CHAR* dest)
{
CHAR *curp,*lastp;

memset(dest,0,33*sizeof(CHAR));/* caller sends midiline[33] */
_mm_read_UBYTES(dest,32,r);
curp=lastp=dest;
/* remove blanks and uppercase all */
Expand Down
5 changes: 2 additions & 3 deletions external/libmikmod/loaders/load_m15.c
Expand Up @@ -92,7 +92,6 @@ static BOOL LoadModuleHeader(MODULEHEADER *h)
int t,u;

_mm_read_string(h->songname,20,modreader);
h->songname[20]=0; /* just in case */

/* sanity check : title should contain printable characters and a bunch
of null chars */
Expand All @@ -105,7 +104,6 @@ static BOOL LoadModuleHeader(MODULEHEADER *h)
MSAMPINFO *s=&h->samples[t];

_mm_read_string(s->samplename,22,modreader);
s->samplename[22]=0; /* just in case */
s->length =_mm_read_M_UWORD(modreader);
s->finetune =_mm_read_UBYTE(modreader);
s->volume =_mm_read_UBYTE(modreader);
Expand Down Expand Up @@ -180,6 +178,7 @@ static BOOL M15_Test(void)
MODULEHEADER h;

ust_loader = 0;
memset(&h, 0, sizeof(MODULEHEADER));
if(!LoadModuleHeader(&h)) return 0;

/* reject other file types */
Expand Down Expand Up @@ -242,7 +241,7 @@ static BOOL M15_Test(void)

static BOOL M15_Init(void)
{
if(!(mh=(MODULEHEADER*)_mm_malloc(sizeof(MODULEHEADER)))) return 0;
if(!(mh=(MODULEHEADER*)_mm_calloc(1,sizeof(MODULEHEADER)))) return 0;
return 1;
}

Expand Down
8 changes: 7 additions & 1 deletion external/libmikmod/loaders/load_med.c
Expand Up @@ -554,8 +554,14 @@ static BOOL MED_Load(BOOL curious)
/* copy song positions */
if (!AllocPositions(ms->songlen))
return 0;
for (t = 0; t < ms->songlen; t++)
for (t = 0; t < ms->songlen; t++) {
of.positions[t] = ms->playseq[t];
if (of.positions[t]>ms->numblocks) { /* SANITIY CHECK */
/* fprintf(stderr,"positions[%d]=%d > numpat=%d\n",t,of.positions[t],ms->numblocks);*/
_mm_errno = MMERR_LOADING_HEADER;
return 0;
}
}

decimalvolumes = (ms->flags & 0x10) ? 0 : 1;
bpmtempos = (ms->flags2 & 0x20) ? 1 : 0;
Expand Down
8 changes: 7 additions & 1 deletion external/libmikmod/loaders/load_mtm.c
Expand Up @@ -217,8 +217,14 @@ static BOOL MTM_Load(BOOL curious)
}

if(!AllocPositions(of.numpos)) return 0;
for(t=0;t<of.numpos;t++)
for(t=0;t<of.numpos;t++) {
of.positions[t]=_mm_read_UBYTE(modreader);
if (of.positions[t]>of.numpat) { /* SANITIY CHECK */
/* fprintf(stderr,"positions[%d]=%d > numpat=%d\n",t,of.positions[t],of.numpat);*/
_mm_errno = MMERR_LOADING_HEADER;
return 0;
}
}
for(;t<128;t++) _mm_skip_BYTE(modreader);
if(_mm_eof(modreader)) {
_mm_errno = MMERR_LOADING_HEADER;
Expand Down
1 change: 1 addition & 0 deletions external/libmikmod/loaders/load_stm.c
Expand Up @@ -103,6 +103,7 @@ static BOOL STM_Test(void)
UBYTE str[44];
int t;

memset(str,0,44);
_mm_fseek(modreader,20,SEEK_SET);
_mm_read_UBYTES(str,44,modreader);
if(str[9]!=2) return 0; /* STM Module = filetype 2 */
Expand Down
4 changes: 3 additions & 1 deletion external/libmikmod/loaders/load_stx.c
Expand Up @@ -114,6 +114,7 @@ static BOOL STX_Test(void)
UBYTE id[8];
int t;

memset(id,0,8);
_mm_fseek(modreader,0x3C,SEEK_SET);
if(!_mm_read_UBYTES(id,4,modreader)) return 0;
if(memcmp(id,"SCRM",4)) return 0;
Expand Down Expand Up @@ -297,7 +298,8 @@ static BOOL STX_Load(BOOL curious)
_mm_errno = MMERR_LOADING_HEADER;
return 0;
}
if(mh->ordnum > 256 || mh->insnum > 256 || mh->patnum > 254) {
if(mh->ordnum > 256 || !mh->insnum || mh->insnum > 256 ||
mh->patnum > 254 || !mh->patnum) {
_mm_errno = MMERR_NOT_A_MODULE;
return 0;
}
Expand Down
20 changes: 14 additions & 6 deletions external/libmikmod/loaders/load_ult.c
Expand Up @@ -206,19 +206,27 @@ static BOOL ULT_Load(BOOL curious)
if(!AllocPositions(256)) return 0;
for(t=0;t<256;t++)
of.positions[t]=_mm_read_UBYTE(modreader);
for(t=0;t<256;t++)
if(of.positions[t]==255) {
of.positions[t]=LAST_PATTERN;
break;
}
of.numpos=t;

noc=_mm_read_UBYTE(modreader);
nop=_mm_read_UBYTE(modreader);

of.numchn=++noc;
of.numpat=++nop;
of.numtrk=of.numchn*of.numpat;

for(t=0;t<256;t++) {
if(of.positions[t]==255) {
of.positions[t]=LAST_PATTERN;
break;
}
if (of.positions[t]>of.numpat) { /* SANITIY CHECK */
/* fprintf(stderr,"positions[%d]=%d > numpat=%d\n",t,of.positions[t],of.numpat);*/
_mm_errno = MMERR_LOADING_HEADER;
return 0;
}
}
of.numpos=t;

if(!AllocTracks()) return 0;
if(!AllocPatterns()) return 0;
for(u=0;u<of.numchn;u++)
Expand Down
11 changes: 8 additions & 3 deletions external/libmikmod/loaders/load_uni.c
Expand Up @@ -623,9 +623,14 @@ static BOOL UNI_Load(BOOL curious)
for(t=0;t<of.numchn;t++) of.panning[t]=mh.panning[t];
}
/* convert the ``end of song'' pattern code if necessary */
if(universion<0x106)
for(t=0;t<of.numpos;t++)
if(of.positions[t]==255) of.positions[t]=LAST_PATTERN;
for(t=0;t<of.numpos;t++) {
if(universion<0x106 && of.positions[t]==255) of.positions[t]=LAST_PATTERN;
else if (of.positions[t]>of.numpat) { /* SANITIY CHECK */
/* fprintf(stderr,"position[%d]=%d > numpat=%d\n",t,of.positions[t],of.numpat);*/
_mm_errno = MMERR_LOADING_HEADER;
return 0;
}
}

/* instruments and samples */
if(universion>=6) {
Expand Down
6 changes: 3 additions & 3 deletions external/libmikmod/m4/libtool.m4
Expand Up @@ -5166,7 +5166,7 @@ _LT_EOF
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;;
Expand Down Expand Up @@ -5872,7 +5872,7 @@ _LT_EOF
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;;
Expand Down Expand Up @@ -6742,7 +6742,7 @@ if test yes != "$_lt_caught_CXX_error"; then
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;;
Expand Down
3 changes: 3 additions & 0 deletions external/libmikmod/macintosh/config.h
Expand Up @@ -3,6 +3,9 @@
/* Define if you have the ANSI C header files. */
/* #undef STDC_HEADERS */

/* disable the high quality mixer (build only with the standart mixer) */
/* #define NO_HQMIXER */

/* Define if you want support for output to stdout */
/* #undef DRV_STDOUT */

Expand Down
1 change: 1 addition & 0 deletions external/libmikmod/mmio/Makefile.in
Expand Up @@ -192,6 +192,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
Expand Down
6 changes: 4 additions & 2 deletions external/libmikmod/os2/Makefile.emx
Expand Up @@ -4,9 +4,10 @@
# make static : builds the static library mikmod_static.lib

INCLUDES=-I../os2 -I../include
AR=emxomfar
ARFLAGS=cr
CC=gcc
AR=ar #emxomfar
ARFLAGS=cr
RANLIB=ranlib
IMPLIB=emximp

CFLAGS=-O2 -Wall -funroll-loops -ffast-math -fno-strength-reduce -Zomf -Zmt
Expand Down Expand Up @@ -77,6 +78,7 @@ $(DLLNAME): $(OBJ) $(DEFNAME)
$(LIBSTATIC): CPPFLAGS+=-DMIKMOD_STATIC
$(LIBSTATIC): $(OBJ)
$(AR) $(ARFLAGS) $(LIBSTATIC) $(OBJ)
$(RANLIB) $(LIBSTATIC)

HEADER_DEPS=../include/mikmod.h ../include/mikmod_internals.h ../include/mikmod_ctype.h
drv_dart.o: ../drivers/drv_dart.c $(HEADER_DEPS)
Expand Down
1 change: 1 addition & 0 deletions external/libmikmod/playercode/Makefile.in
Expand Up @@ -192,6 +192,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
Expand Down

0 comments on commit c72476f

Please sign in to comment.