ROBOTC.net forums
http://www.robotc.net/forums/

Is there #pragma once
http://www.robotc.net/forums/viewtopic.php?f=53&t=11653
Page 1 of 1

Author:  abhinavmadahar [ Sat Jul 04, 2015 2:10 pm ]
Post subject:  Is there #pragma once

In compilers like GCC, you can use #pragma once

Is there such a thing in RobotC?

Author:  mightor [ Tue Jul 07, 2015 1:24 am ]
Post subject:  Re: Is there #pragma once

No, there is not. What I tend to do is this:
Code:
#ifndef __INCLUDE_FILE_NAME_H__
#define __INCLUDE_FILE_NAME_H__

void some_func();
void another_func();

void some_func()
{
  // do something super useful
  return;
}

void another_func()
{
  // do something useful
  return;
}

#endif // __INCLUDE_FILE_NAME_H__

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/