libco: Fix linking and compiling under osx. (nw)

This commit is contained in:
Wilbert Pol 2011-06-25 15:20:01 +00:00
parent 8d77f85937
commit 06623947e3
2 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ cothread_t co_create(unsigned int size, void (*entrypoint)(void)) {
size += 256; /* allocate additional space for storage */
size &= ~15; /* align stack to 16-byte boundary */
if(handle = (cothread_t)malloc(size)) {
if((handle = (cothread_t)malloc(size))) {
long *p = (long*)((char*)handle + size); /* seek to top of stack */
*--p = (long)crash; /* crash if entrypoint returns */
*--p = (long)entrypoint; /* start of function */

View File

@ -210,4 +210,4 @@ $(OBJ)/libco.a: $(COTHREADOBJS)
$(LIBOBJ)/cothread/%.o: $(LIBSRC)/cothread/%.c | $(OSPREBUILD)
@echo Compiling $<...
$(CC) -c -fomit-frame-pointer $< -o $@
$(CC) $(CDEFS) $(CCOMFLAGS) -c -fomit-frame-pointer $< -o $@