How to add user defined header files and include those for atmega328p in platformIO

I am new to this platform and embedded development environment, here i am trying to add user defined header file which is same as <avr/io.h> but with different name. It is throwing following error:

below is my main.cpp

#include <defheader.h>                                    

void ms_Delay(void)

{

   unsigned int i = 0;

  for (i = 0; i < 1257; i++);

}

void setup() {

  // put your setup code here, to run once:

  DDRB |= 0xFF; //Configured Port B as OP

  DDRD &= 0x00; //Configured Port D as IP

}

void loop() {

   // PORTB |= 0xFF;

  PORTB |= (1<<4);

  ms_Delay();

    // PORTB &= 0x00;

  PORTB &= ~(1<<4);  

  ms_Delay();

}

…why.

  1. you failed to delete the
#ifndef _AVR_IO_H_
#  error "Include <avr/io.h> instead of this file."
#endif

block at the top your copied defheader.h file

  1. you did not #include <avr/sfr_defs.h> at the top of your header like avr/io.h does, hence the _SFR_IO8 definition error.