Fixes for Linux build

This commit is contained in:
Aaron Culliney 2014-06-21 23:08:07 -07:00
parent fd2f143c64
commit 670a776571
4 changed files with 16 additions and 4 deletions

View File

@ -27,7 +27,7 @@
/* Symbol naming issues */
#ifdef NO_UNDERSCORES
#define SN(foo) foo
#define SNX(foo, INDEX, SCALE) _##foo(%rip,INDEX,SCALE)
#define SNX(foo, INDEX, SCALE) foo(,INDEX,SCALE)
#define E(foo) .globl foo; .balign 16; foo##:
#define CALL(foo) foo
#else /* !NO_UNDERSCORES */

View File

@ -143,9 +143,10 @@ void c_eject_6(int drive) {
{
ERRLOG("OOPS: An error occurred when attempting to compress a disk image : %s", err);
#ifdef INTERFACE_CLASSIC
int ch = -1;
snprintf(&zlibmenu[4][2], 37, "%s", err);
c_interface_print_submenu_centered(zlibmenu[0], ZLIB_SUBMENU_W, ZLIB_SUBMENU_H);
while ((int ch = c_mygetch(1)) == -1) {
while ((ch = c_mygetch(1)) == -1) {
// ...
}
#endif
@ -190,9 +191,10 @@ int c_new_diskette_6(int drive, const char * const raw_file_name, int force) {
{
ERRLOG("OOPS: An error occurred when attempting to inflate/load a disk image : %s", err);
#ifdef INTERFACE_CLASSIC
int ch = -1;
snprintf(&zlibmenu[4][2], 37, "%s", err);
c_interface_print_submenu_centered(zlibmenu[0], ZLIB_SUBMENU_W, ZLIB_SUBMENU_H);
while ((int ch = c_mygetch(1)) == -1) {
while ((ch = c_mygetch(1)) == -1) {
// ...
}
#endif

View File

@ -372,6 +372,7 @@ bool save_settings(void)
#define ERROR_SUBMENU_H 9
#define ERROR_SUBMENU_W 40
#ifdef INTERFACE_CLASSIC
int ch = -1;
char submenu[ERROR_SUBMENU_H][ERROR_SUBMENU_W+1] =
//1. 5. 10. 15. 20. 25. 30. 35. 40.
{ "||||||||||||||||||||||||||||||||||||||||",
@ -391,7 +392,7 @@ bool save_settings(void)
PREFS_ERRPRINT();
#ifdef INTERFACE_CLASSIC
c_interface_print_submenu_centered(submenu[0], ERROR_SUBMENU_W, ERROR_SUBMENU_H);
while ((int ch = c_mygetch(1)) == -1)
while ((ch = c_mygetch(1)) == -1)
{
}
#endif

View File

@ -142,7 +142,16 @@ GLUE_C_READ(read_keyboard_strobe)
GLUE_C_READ(read_random)
{
#ifdef __APPLE__
return arc4random_uniform(0x100);
#else
static time_t seed=0;
if (!seed) {
seed = time(NULL);
srandom(seed);
}
return (random() % UINT_MAX);
#endif
}
GLUE_C_READ(speaker_toggle)