libcamera: base: Convert to pragma once

Remove the verbose #ifndef/#define/#endif pattern for maintaining
header idempotency, and replace it with a simple #pragma once.

This simplifies the headers, and prevents redundant changes when
header files get moved.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
This commit is contained in:
Kieran Bingham 2021-11-23 17:23:07 +00:00
parent 0a64cf8b76
commit 0701f756b9
17 changed files with 33 additions and 68 deletions

View file

@ -4,8 +4,8 @@
*
* backtrace.h - Call stack backtraces
*/
#ifndef __LIBCAMERA_BASE_BACKTRACE_H__
#define __LIBCAMERA_BASE_BACKTRACE_H__
#pragma once
#include <string>
#include <vector>
@ -34,5 +34,3 @@ private:
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_BASE_BACKTRACE_H__ */

View file

@ -4,8 +4,8 @@
*
* bound_method.h - Method bind and invocation
*/
#ifndef __LIBCAMERA_BASE_BOUND_METHOD_H__
#define __LIBCAMERA_BASE_BOUND_METHOD_H__
#pragma once
#include <memory>
#include <tuple>
@ -222,5 +222,3 @@ private:
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_BASE_BOUND_METHOD_H__ */

View file

@ -4,8 +4,8 @@
*
* class.h - Utilities and helpers for classes
*/
#ifndef __LIBCAMERA_BASE_CLASS_H__
#define __LIBCAMERA_BASE_CLASS_H__
#pragma once
#include <memory>
@ -107,5 +107,3 @@ private:
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_BASE_CLASS_H__ */

View file

@ -4,8 +4,8 @@
*
* event_dispatcher.h - Event dispatcher
*/
#ifndef __LIBCAMERA_BASE_EVENT_DISPATCHER_H__
#define __LIBCAMERA_BASE_EVENT_DISPATCHER_H__
#pragma once
#include <vector>
@ -33,5 +33,3 @@ public:
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_BASE_EVENT_DISPATCHER_H__ */

View file

@ -4,8 +4,8 @@
*
* event_dispatcher_poll.h - Poll-based event dispatcher
*/
#ifndef __LIBCAMERA_BASE_EVENT_DISPATCHER_POLL_H__
#define __LIBCAMERA_BASE_EVENT_DISPATCHER_POLL_H__
#pragma once
#include <list>
#include <map>
@ -56,5 +56,3 @@ private:
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_BASE_EVENT_DISPATCHER_POLL_H__ */

View file

@ -4,8 +4,8 @@
*
* event_notifier.h - File descriptor event notifier
*/
#ifndef __LIBCAMERA_BASE_EVENT_NOTIFIER_H__
#define __LIBCAMERA_BASE_EVENT_NOTIFIER_H__
#pragma once
#include <libcamera/base/private.h>
@ -46,5 +46,3 @@ private:
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_BASE_EVENT_NOTIFIER_H__ */

View file

@ -4,8 +4,8 @@
*
* file.h - File I/O operations
*/
#ifndef __LIBCAMERA_BASE_FILE_H__
#define __LIBCAMERA_BASE_FILE_H__
#pragma once
#include <sys/types.h>
@ -84,5 +84,3 @@ LIBCAMERA_FLAGS_ENABLE_OPERATORS(File::MapFlag)
LIBCAMERA_FLAGS_ENABLE_OPERATORS(File::OpenModeFlag)
} /* namespace libcamera */
#endif /* __LIBCAMERA_BASE_FILE_H__ */

View file

@ -4,8 +4,8 @@
*
* flags.h - Type-safe enum-based bitfields
*/
#ifndef __LIBCAMERA_BASE_FLAGS_H__
#define __LIBCAMERA_BASE_FLAGS_H__
#pragma once
#include <type_traits>
@ -191,5 +191,3 @@ struct flags_enable_operators<_enum> { \
#endif /* __DOXYGEN__ */
} /* namespace libcamera */
#endif /* __LIBCAMERA_BASE_FLAGS_H__ */

View file

@ -4,8 +4,8 @@
*
* log.h - Logging infrastructure
*/
#ifndef __LIBCAMERA_BASE_LOG_H__
#define __LIBCAMERA_BASE_LOG_H__
#pragma once
#include <chrono>
#include <sstream>
@ -128,5 +128,3 @@ LogMessage _log(const LogCategory *category, LogSeverity severity,
#endif
} /* namespace libcamera */
#endif /* __LIBCAMERA_BASE_LOG_H__ */

View file

@ -4,8 +4,8 @@
*
* message.h - Message queue support
*/
#ifndef __LIBCAMERA_BASE_MESSAGE_H__
#define __LIBCAMERA_BASE_MESSAGE_H__
#pragma once
#include <atomic>
@ -67,5 +67,3 @@ private:
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_BASE_MESSAGE_H__ */

View file

@ -4,8 +4,8 @@
*
* object.h - Base object
*/
#ifndef __LIBCAMERA_BASE_OBJECT_H__
#define __LIBCAMERA_BASE_OBJECT_H__
#pragma once
#include <list>
#include <memory>
@ -67,5 +67,3 @@ private:
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_BASE_OBJECT_H__ */

View file

@ -4,8 +4,8 @@
*
* semaphore.h - General-purpose counting semaphore
*/
#ifndef __LIBCAMERA_BASE_SEMAPHORE_H__
#define __LIBCAMERA_BASE_SEMAPHORE_H__
#pragma once
#include <condition_variable>
@ -31,5 +31,3 @@ private:
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_BASE_SEMAPHORE_H__ */

View file

@ -4,8 +4,8 @@
*
* signal.h - Signal & slot implementation
*/
#ifndef __LIBCAMERA_BASE_SIGNAL_H__
#define __LIBCAMERA_BASE_SIGNAL_H__
#pragma once
#include <functional>
#include <list>
@ -147,5 +147,3 @@ public:
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_BASE_SIGNAL_H__ */

View file

@ -5,8 +5,7 @@
* span.h - C++20 std::span<> implementation for C++11
*/
#ifndef __LIBCAMERA_BASE_SPAN_H__
#define __LIBCAMERA_BASE_SPAN_H__
#pragma once
#include <array>
#include <iterator>
@ -420,5 +419,3 @@ private:
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_BASE_SPAN_H__ */

View file

@ -4,8 +4,8 @@
*
* thread.h - Thread support
*/
#ifndef __LIBCAMERA_BASE_THREAD_H__
#define __LIBCAMERA_BASE_THREAD_H__
#pragma once
#include <memory>
#include <mutex>
@ -74,5 +74,3 @@ private:
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_BASE_THREAD_H__ */

View file

@ -4,8 +4,8 @@
*
* timer.h - Generic timer
*/
#ifndef __LIBCAMERA_BASE_TIMER_H__
#define __LIBCAMERA_BASE_TIMER_H__
#pragma once
#include <chrono>
#include <stdint.h>
@ -47,5 +47,3 @@ private:
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_BASE_TIMER_H__ */

View file

@ -4,8 +4,8 @@
*
* utils.h - Miscellaneous utility functions
*/
#ifndef __LIBCAMERA_BASE_UTILS_H__
#define __LIBCAMERA_BASE_UTILS_H__
#pragma once
#include <algorithm>
#include <chrono>
@ -355,5 +355,3 @@ std::basic_ostream<CharT, Traits> &operator<<(std::basic_ostream<CharT, Traits>
#endif
} /* namespace libcamera */
#endif /* __LIBCAMERA_BASE_UTILS_H__ */