fixed -L directory order in lib/Makefile.am to avoid linking to libmoo-xxx shared objects when MOO_ENABLE_STATIC_MODULE is on and $(libdir) contains libmoo-xxx files - place the module build directory in front of other library directories.

fixed problems when MOO_OOCH_IS_BCH
This commit is contained in:
hyunghwan.chung
2017-02-03 06:28:12 +00:00
parent ea6d48eb0e
commit 54a2128713
12 changed files with 118 additions and 31 deletions

View File

@ -173,6 +173,7 @@ static moo_pfrc_t pf_write (moo_t* moo, moo_ooi_t nargs)
return MOO_PF_FAILURE;
}
#if defined(MOO_OOCH_IS_UCH)
ucspos = 0;
ucsrem = MOO_OBJ_GET_SIZE(oomsg);
while (ucsrem > 0)
@ -189,6 +190,9 @@ static moo_pfrc_t pf_write (moo_t* moo, moo_ooi_t nargs)
ucspos += ucslen;
ucsrem -= ucslen;
}
#else
write (con->fd, oomsg->slot, MOO_OBJ_GET_SIZE(oomsg)); /* TODO: error handling. incomplete write handling */
#endif
MOO_STACK_SETRETTORCV (moo, nargs); /* TODO: change return code */
return MOO_PF_SUCCESS;

View File

@ -142,6 +142,7 @@ static moo_pfrc_t __pf_puts (moo_t* moo, moo_ooi_t nargs, moo_oow_t limit)
}
else if (MOO_OOP_IS_POINTER(x) && MOO_OBJ_GET_FLAGS_TYPE(x) == MOO_OBJ_TYPE_CHAR)
{
#if defined(MOO_OOCH_IS_UCH)
int n;
moo_oow_t ucspos, ucsrem, ucslen, bcslen;
moo_bch_t bcs[1024]; /* TODO: choose a better buffer size */
@ -172,6 +173,15 @@ static moo_pfrc_t __pf_puts (moo_t* moo, moo_ooi_t nargs, moo_oow_t limit)
ucspos += ucslen;
ucsrem -= ucslen;
}
#else
puts_string:
if (fwrite (x->slot, 1, MOO_OBJ_GET_SIZE(x), rcv->fp) < MOO_OBJ_GET_SIZE(x))
{
moo_seterrnum (moo, moo_syserrtoerrnum(errno));
moo_seterrnum (moo, moo_syserrtoerrnum(errno));
goto softfail;
}
#endif
}
else
{