endif
ifeq (${shell uname}, Darwin)
+# gcc 4.2 from MacOS is really not up to scratch anymore
+CC = clang
AVR_ROOT := "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/"
AVR_INC := ${AVR_ROOT}/avr-4/
AVR := ${AVR_ROOT}/bin/avr-
AVR_CPPFLAGS= ${CPPFLAGS} -idirafter ${AVR_INC}/include
-CC = gcc
+CC ?= gcc
AR ?= ar
RANLIB ?= ranlib
MKDIR ?= mkdir -p
static inline c3geometry_type_t
c3geometry_type(int type, int subtype)
{
- c3geometry_type_t r = { .type = type, . subtype = subtype };
+ c3geometry_type_t r = { .type = type, .subtype = subtype };
return r;
}
case 0xc000: {
// RJMP 1100 kkkk kkkk kkkk
- short o = ((short)(opcode << 4)) >> 4;
+// int16_t o = ((int16_t)(opcode << 4)) >> 4; // CLANG BUG!
+ int16_t o = ((int16_t)((opcode << 4)&0xffff)) >> 4;
STATE("rjmp .%d [%04x]\n", o, new_pc + (o << 1));
new_pc = new_pc + (o << 1);
cycle++;
case 0xd000: {
// RCALL 1100 kkkk kkkk kkkk
- short o = ((short)(opcode << 4)) >> 4;
+// int16_t o = ((int16_t)(opcode << 4)) >> 4; // CLANG BUG!
+ int16_t o = ((int16_t)((opcode << 4)&0xffff)) >> 4;
STATE("rcall .%d [%04x]\n", o, new_pc + (o << 1));
_avr_push16(avr, new_pc >> 1);
new_pc = new_pc + (o << 1);
case 0xf200:
case 0xf400:
case 0xf600: { // All the SREG branches
- short o = ((short)(opcode << 6)) >> 9; // offset
+ int16_t o = ((int16_t)(opcode << 6)) >> 9; // offset
uint8_t s = opcode & 7;
int set = (opcode & 0x0400) == 0; // this bit means BRXC otherwise BRXS
int branch = (avr->sreg[s] && set) || (!avr->sreg[s] && !set);
cycle_timer_longjmp_cb(struct avr_t *avr, avr_cycle_count_t when, void *param) {
jmp_buf *jmp = param;
longjmp(*jmp, LJR_CYCLE_TIMER);
+ return 0; // clear warning
}
static jmp_buf *special_deinit_jmpbuf = NULL;