Added support to compile ASE for Mac OS X (thanks to Trent Gamblin).

This commit is contained in:
David Capello 2009-08-17 00:26:05 +00:00
parent e1e60ab914
commit 2bc2db1630
5 changed files with 19 additions and 19 deletions

View File

@ -117,7 +117,7 @@ DIRS *filename_in_datadir(const char *filename)
DIRS *dirs = dirs_new();
char buf[1024];
#if defined ALLEGRO_UNIX
#if defined ALLEGRO_UNIX || defined ALLEGRO_MACOSX
/* $HOME/.ase/filename */
sprintf(buf, ".ase/%s", filename);
@ -153,7 +153,7 @@ DIRS *filename_in_homedir(const char *filename)
{
DIRS *dirs = dirs_new();
#if defined ALLEGRO_UNIX
#if defined ALLEGRO_UNIX || defined ALLEGRO_MACOSX
char *env = getenv("HOME");
char buf[1024];
@ -187,7 +187,7 @@ DIRS *cfg_filename_dirs()
{
DIRS *dirs = dirs_new();
#if defined ALLEGRO_UNIX
#if defined ALLEGRO_UNIX || defined ALLEGRO_MACOSX
/* $HOME/.asepriterc */
dirs_cat_dirs(dirs, filename_in_homedir(".asepriterc"));

View File

@ -43,10 +43,10 @@
#define USE_PIDLS
#endif
#if defined ALLEGRO_UNIX || defined ALLEGRO_DJGPP || defined ALLEGRO_MINGW32
#if defined ALLEGRO_UNIX || defined ALLEGRO_MACOSX || defined ALLEGRO_DJGPP || defined ALLEGRO_MINGW32
#include <sys/stat.h>
#endif
#if defined ALLEGRO_UNIX || defined ALLEGRO_MINGW32
#if defined ALLEGRO_UNIX || defined ALLEGRO_MACOSX || defined ALLEGRO_MINGW32
#include <sys/unistd.h>
#endif

View File

@ -36,10 +36,10 @@
#include <allegro/internal/aintern.h>
#include <errno.h>
#include <string.h>
#if defined ALLEGRO_UNIX || defined ALLEGRO_DJGPP || defined ALLEGRO_MINGW32
#if defined ALLEGRO_UNIX || defined ALLEGRO_MACOSX || defined ALLEGRO_DJGPP || defined ALLEGRO_MINGW32
# include <sys/stat.h>
#endif
#if defined ALLEGRO_UNIX || defined ALLEGRO_MINGW32
#if defined ALLEGRO_UNIX || defined ALLEGRO_MACOSX || defined ALLEGRO_MINGW32
# include <sys/unistd.h>
#endif

View File

@ -39,11 +39,11 @@
#if defined ALLEGRO_WINDOWS
#include <winalleg.h>
#include <process.h>
#elif defined ALLEGRO_UNIX
#elif defined ALLEGRO_UNIX || defined ALLEGRO_MACOSX
#include <pthread.h>
#endif
#if defined ALLEGRO_UNIX
#if defined ALLEGRO_UNIX || defined ALLEGRO_MACOSX
struct pthread_proxy_data {
void (*proc)(void*);
void* data;
@ -65,7 +65,7 @@ JThread jthread_new(void (*proc)(void*), void* data)
{
#if defined ALLEGRO_WINDOWS
return (JThread)_beginthread(proc, 0, data);
#elif defined ALLEGRO_UNIX
#elif defined ALLEGRO_UNIX || defined ALLEGRO_MACOSX
pthread_t thread = 0;
struct pthread_proxy_data *ptr = jnew(struct pthread_proxy_data, 1);
ptr->proc = proc;
@ -84,7 +84,7 @@ void jthread_join(JThread thread)
{
#if defined ALLEGRO_WINDOWS
WaitForSingleObject(thread, INFINITE);
#elif defined ALLEGRO_UNIX
#elif defined ALLEGRO_UNIX || defined ALLEGRO_MACOSX
pthread_join((pthread_t)thread, NULL);
#else
#error ASE does not support threads for your platform

View File

@ -503,7 +503,7 @@ void ImageImpl<RgbTraits>::to_allegro(BITMAP *bmp, int _x, int _y) const
switch (depth) {
case 8:
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
#if defined GFX_MODEX && !defined ALLEGRO_UNIX && !defined ALLEGRO_MACOSX
if (is_planar_bitmap(bmp)) {
for (y=0; y<h; y++) {
bmp_address = (unsigned long)bmp->line[_y];
@ -536,7 +536,7 @@ void ImageImpl<RgbTraits>::to_allegro(BITMAP *bmp, int _x, int _y) const
_y++;
}
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
#if defined GFX_MODEX && !defined ALLEGRO_UNIX && !defined ALLEGRO_MACOSX
}
#endif
break;
@ -635,7 +635,7 @@ void ImageImpl<GrayscaleTraits>::to_allegro(BITMAP *bmp, int _x, int _y) const
switch (depth) {
case 8:
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
#if defined GFX_MODEX && !defined ALLEGRO_UNIX && !defined ALLEGRO_MACOSX
if (is_planar_bitmap(bmp)) {
for (y=0; y<h; y++) {
bmp_address = (unsigned long)bmp->line[_y];
@ -663,7 +663,7 @@ void ImageImpl<GrayscaleTraits>::to_allegro(BITMAP *bmp, int _x, int _y) const
_y++;
}
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
#if defined GFX_MODEX && !defined ALLEGRO_UNIX && !defined ALLEGRO_MACOSX
}
#endif
break;
@ -766,7 +766,7 @@ void ImageImpl<IndexedTraits>::to_allegro(BITMAP *bmp, int _x, int _y) const
switch (depth) {
case 8:
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
#if defined GFX_MODEX && !defined ALLEGRO_UNIX && !defined ALLEGRO_MACOSX
if (is_planar_bitmap (bmp)) {
for (y=0; y<h; y++) {
bmp_address = (unsigned long)bmp->line[_y];
@ -793,7 +793,7 @@ void ImageImpl<IndexedTraits>::to_allegro(BITMAP *bmp, int _x, int _y) const
_y++;
}
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
#if defined GFX_MODEX && !defined ALLEGRO_UNIX && !defined ALLEGRO_MACOSX
}
#endif
break;
@ -884,7 +884,7 @@ void ImageImpl<BitmapTraits>::to_allegro(BITMAP *bmp, int _x, int _y) const
color[0] = makecol8(0, 0, 0);
color[1] = makecol8(255, 255, 255);
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
#if defined GFX_MODEX && !defined ALLEGRO_UNIX && !defined ALLEGRO_MACOSX
if (is_planar_bitmap(bmp)) {
for (y=0; y<h; y++) {
addr = line_address(y);
@ -915,7 +915,7 @@ void ImageImpl<BitmapTraits>::to_allegro(BITMAP *bmp, int _x, int _y) const
_y++;
}
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
#if defined GFX_MODEX && !defined ALLEGRO_UNIX && !defined ALLEGRO_MACOSX
}
#endif
break;