5 years, 2 months ago.

#pragma once in SerialPipe.cpp


Maybe this just shows my ignorance about c++ but what does the #pragma once mean in SerialPipe.cpp.

As far as I understand it is used in header files to prevent multiple inclusion. Is this meant to be here? If so what does it do?

Thanks in advance Richard

Question relating to:

support library for C027 helper functions for Buffer Pipes, Buffered Serial Port (rtos capable) and GPS parsing. It includes modem APIs for USSD, SMS and Sockets. C027, u-blox

http://infocenter.arm.com/help/topic/com.arm.doc.dui0491c/DUI0491C_arm_compiler_reference.pdf section 5.91 - as you say for header files usually though...

posted by D J 17 Dec 2014

as i said it can be removed. it is not needed.

posted by Michael Ammann 17 Dec 2014

1 Answer

5 years, 2 months ago.

it is a multiple header inclusion guard.


its a left over, we can remove.

Accepted Answer

Hi Michael, I can very much understand why it has been put in SerialPipe.h but I was just wondering why it was in SerialPipe.cpp as well, and if this was intentional.

posted by Richard Osterloh 17 Dec 2014