More GNO and ORCA/C compatibility fixes.

Everything in the shell directory now compiles.
This commit is contained in:
Stephen Heumann 2014-11-01 18:25:21 -05:00
parent 2464399542
commit 875b1bbd0e
4 changed files with 18 additions and 6 deletions

View File

@ -1580,7 +1580,11 @@ struct globals;
* If you want to assign a value, use SET_PTR_TO_GLOBALS(x) */
extern struct globals *const ptr_to_globals;
/* At least gcc 3.4.6 on mipsel system needs optimization barrier */
#ifndef __ORCAC__
# define barrier() __asm__ __volatile__("":::"memory")
#else
# define barrier()
#endif
#define SET_PTR_TO_GLOBALS(x) do { \
(*(struct globals**)&ptr_to_globals) = (void*)(x); \
barrier(); \

View File

@ -202,7 +202,7 @@ typedef unsigned smalluint;
#endif
/* Define bb_setpgrp */
#if defined(__digital__) && defined(__unix__)
#if defined(__digital__) && defined(__unix__) || defined(__GNO__)
/* use legacy setpgrp(pid_t, pid_t) for now. move to platform.c */
# define bb_setpgrp() do { pid_t __me = getpid(); setpgrp(__me, __me); } while (0)
#else

View File

@ -6117,7 +6117,7 @@ static void xforked_grandchild(void *args_struct) {
/* squirrel != NULL means we squirrel away copies of stdin, stdout,
* and stderr if they are redirected. */
static int setup_redirects(struct command *prog, int squirrel[])
static int setup_redirects(struct command *prog, int *squirrel)
{
int openfd, mode;
struct redir_struct *redir;
@ -6756,7 +6756,11 @@ static void delete_finished_bg_job(struct pipe *pi)
static int checkjobs(struct pipe *fg_pipe)
{
int attributes;
#ifndef __GNO__
int status;
#else
union wait status;
#endif
#if ENABLE_HUSH_JOB
struct pipe *pi;
#endif
@ -7854,7 +7858,7 @@ int hush_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int hush_main(int argc, char **argv)
{
enum {
OPT_login = (1 << 0),
OPT_login = (1 << 0)
};
unsigned flags;
int opt;
@ -9122,7 +9126,11 @@ static int FAST_FUNC builtin_unset(char **argv)
static int FAST_FUNC builtin_wait(char **argv)
{
int ret = EXIT_SUCCESS;
#ifndef __GNO__
int status;
#else
union wait status;
#endif
argv = skip_dash_dash(argv);
if (argv[0] == NULL) {

View File

@ -37,7 +37,7 @@ next_random(random_t *rnd)
/* Galois LFSR parameter:
* Taps at 32 31 29 1:
*/
enum { MASK = 0x8000000b };
const uint32_t MASK = 0x8000000b;
/* Another example - taps at 32 31 30 10: */
/* enum { MASK = 0x00400007 }; */
@ -48,7 +48,7 @@ next_random(random_t *rnd)
enum {
a = 2,
b = 7,
c = 3,
c = 3
};
uint32_t t;