Help : Program not compiling for Arduino Mico but does for Arduino mini ???

All in Title,

in attachement the error message

Hi all, first of all, i’m not a programer, i’ve found this material on the net and try to make it.
source :

Original code can be found here :

Thank for any help.

Below an extract of incrimnated code:

#include <avr/sleep.h>

short button_pin = 2;                //power off button

int buttonState = LOW, lastButtonState = LOW;         // variable for reading the pushbutton status

void goToSleep()         // sleep µP if pin 2 turn from LOW to HIGH
  byte adcsra, mcucr1, mcucr2;
  EIMSK = _BV(INT0);             //enable INT0
  adcsra = ADCSRA;               //save the ADC Control and Status Register A
  ADCSRA = 0;                    //disable ADC
  mcucr1 = MCUCR | _BV(BODS) | _BV(BODSE);  //turn off the brown-out detector
  mcucr2 = mcucr1 & ~_BV(BODSE);
  MCUCR = mcucr1;                //timed sequence
  MCUCR = mcucr2;                //BODS stays active for 3 cycles, sleep instruction must be executed while it's active
  sei();                         //ensure interrupts enabled so we can wake up again
  sleep_cpu();                   //go to sleep
  sleep_disable();               //wake up here
  ADCSRA = adcsra;               //restore ADCSRA

The Arduino mini uses the ATmega328P MCU and the Arduino Micro uses the ATmega32U4 MCU so probably your code that hits the hardware directly will not work as the MCU's don't have the same register and instruction names (or maybe not the same registers).

I would suggest you use a library to sleep the MCU (something like Adafruit Sleepydog) as it will work with multiple MCU types or use the MCU datasheets to alter the code you pasted yourself.