summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2021-11-23 17:23:07 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2021-11-24 12:18:11 +0000
commit0701f756b98b7b4d2e882f2f5aee9d160ebeba72 (patch)
tree938dc8f18bd265be4a57659af4552e287c50083a
parent0a64cf8b7645a90b289f270ad585e8f703350099 (diff)
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>
-rw-r--r--include/libcamera/base/backtrace.h6
-rw-r--r--include/libcamera/base/bound_method.h6
-rw-r--r--include/libcamera/base/class.h6
-rw-r--r--include/libcamera/base/event_dispatcher.h6
-rw-r--r--include/libcamera/base/event_dispatcher_poll.h6
-rw-r--r--include/libcamera/base/event_notifier.h6
-rw-r--r--include/libcamera/base/file.h6
-rw-r--r--include/libcamera/base/flags.h6
-rw-r--r--include/libcamera/base/log.h6
-rw-r--r--include/libcamera/base/message.h6
-rw-r--r--include/libcamera/base/object.h6
-rw-r--r--include/libcamera/base/semaphore.h6
-rw-r--r--include/libcamera/base/signal.h6
-rw-r--r--include/libcamera/base/span.h5
-rw-r--r--include/libcamera/base/thread.h6
-rw-r--r--include/libcamera/base/timer.h6
-rw-r--r--include/libcamera/base/utils.h6
17 files changed, 33 insertions, 68 deletions
diff --git a/include/libcamera/base/backtrace.h b/include/libcamera/base/backtrace.h
index bb77c73b..752034d1 100644
--- a/include/libcamera/base/backtrace.h
+++ b/include/libcamera/base/backtrace.h
@@ -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__ */
diff --git a/include/libcamera/base/bound_method.h b/include/libcamera/base/bound_method.h
index ebd297ab..e73a4d98 100644
--- a/include/libcamera/base/bound_method.h
+++ b/include/libcamera/base/bound_method.h
@@ -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__ */
diff --git a/include/libcamera/base/class.h b/include/libcamera/base/class.h
index 09806cd7..571eecf4 100644
--- a/include/libcamera/base/class.h
+++ b/include/libcamera/base/class.h
@@ -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__ */
diff --git a/include/libcamera/base/event_dispatcher.h b/include/libcamera/base/event_dispatcher.h
index 825af7a3..184f1b12 100644
--- a/include/libcamera/base/event_dispatcher.h
+++ b/include/libcamera/base/event_dispatcher.h
@@ -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__ */
diff --git a/include/libcamera/base/event_dispatcher_poll.h b/include/libcamera/base/event_dispatcher_poll.h
index 683934bf..3d2fc7bb 100644
--- a/include/libcamera/base/event_dispatcher_poll.h
+++ b/include/libcamera/base/event_dispatcher_poll.h
@@ -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__ */
diff --git a/include/libcamera/base/event_notifier.h b/include/libcamera/base/event_notifier.h
index f7722a32..e5c0594d 100644
--- a/include/libcamera/base/event_notifier.h
+++ b/include/libcamera/base/event_notifier.h
@@ -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__ */
diff --git a/include/libcamera/base/file.h b/include/libcamera/base/file.h
index 60851d38..55e8edd9 100644
--- a/include/libcamera/base/file.h
+++ b/include/libcamera/base/file.h
@@ -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__ */
diff --git a/include/libcamera/base/flags.h b/include/libcamera/base/flags.h
index adec549d..bff3b93c 100644
--- a/include/libcamera/base/flags.h
+++ b/include/libcamera/base/flags.h
@@ -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__ */
diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h
index 866a2133..3f065267 100644
--- a/include/libcamera/base/log.h
+++ b/include/libcamera/base/log.h
@@ -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__ */
diff --git a/include/libcamera/base/message.h b/include/libcamera/base/message.h
index 5d2a9f04..65572c74 100644
--- a/include/libcamera/base/message.h
+++ b/include/libcamera/base/message.h
@@ -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__ */
diff --git a/include/libcamera/base/object.h b/include/libcamera/base/object.h
index 5c385ab4..25dcbc04 100644
--- a/include/libcamera/base/object.h
+++ b/include/libcamera/base/object.h
@@ -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__ */
diff --git a/include/libcamera/base/semaphore.h b/include/libcamera/base/semaphore.h
index d8146eb8..ae87d319 100644
--- a/include/libcamera/base/semaphore.h
+++ b/include/libcamera/base/semaphore.h
@@ -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__ */
diff --git a/include/libcamera/base/signal.h b/include/libcamera/base/signal.h
index 8d9f82f6..91000d0d 100644
--- a/include/libcamera/base/signal.h
+++ b/include/libcamera/base/signal.h
@@ -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__ */
diff --git a/include/libcamera/base/span.h b/include/libcamera/base/span.h
index 21099d56..88d2e3de 100644
--- a/include/libcamera/base/span.h
+++ b/include/libcamera/base/span.h
@@ -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__ */
diff --git a/include/libcamera/base/thread.h b/include/libcamera/base/thread.h
index e0ca0aea..32ebc80a 100644
--- a/include/libcamera/base/thread.h
+++ b/include/libcamera/base/thread.h
@@ -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__ */
diff --git a/include/libcamera/base/timer.h b/include/libcamera/base/timer.h
index 44876a85..09f1d322 100644
--- a/include/libcamera/base/timer.h
+++ b/include/libcamera/base/timer.h
@@ -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__ */
diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h
index 2b761436..3a803176 100644
--- a/include/libcamera/base/utils.h
+++ b/include/libcamera/base/utils.h
@@ -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__ */