include: Switch to #pragma once pattern
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
diff --git a/include/osmocom/core/application.h b/include/osmocom/core/application.h
index 3457169..ecaeaa8 100644
--- a/include/osmocom/core/application.h
+++ b/include/osmocom/core/application.h
@@ -1,5 +1,4 @@
-#ifndef OSMO_APPLICATION_H
-#define OSMO_APPLICATION_H
+#pragma once
/*!
* \file application.h
@@ -19,5 +18,3 @@
int osmo_init_logging(const struct log_info *);
int osmo_daemonize(void);
-
-#endif
diff --git a/include/osmocom/core/backtrace.h b/include/osmocom/core/backtrace.h
index a24290c..0c9b6ef 100644
--- a/include/osmocom/core/backtrace.h
+++ b/include/osmocom/core/backtrace.h
@@ -1,7 +1,4 @@
-#ifndef _OSMO_BACKTRACE_H_
-#define _OSMO_BACKTRACE_H_
+#pragma once
void osmo_generate_backtrace(void);
void osmo_log_backtrace(int subsys, int level);
-
-#endif
diff --git a/include/osmocom/core/bits.h b/include/osmocom/core/bits.h
index 4c68532..d4ab505 100644
--- a/include/osmocom/core/bits.h
+++ b/include/osmocom/core/bits.h
@@ -1,5 +1,4 @@
-#ifndef _OSMO_BITS_H
-#define _OSMO_BITS_H
+#pragma once
#include <stdint.h>
@@ -74,5 +73,3 @@
void osmo_revbytebits_buf(uint8_t *buf, int len);
/*! @} */
-
-#endif /* _OSMO_BITS_H */
diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h
index 9c000d0..3138226 100644
--- a/include/osmocom/core/bitvec.h
+++ b/include/osmocom/core/bitvec.h
@@ -1,5 +1,4 @@
-#ifndef _BITVEC_H
-#define _BITVEC_H
+#pragma once
/* bit vector utility routines */
@@ -66,5 +65,3 @@
int bitvec_spare_padding(struct bitvec *bv, unsigned int up_to_bit);
/*! @} */
-
-#endif /* _BITVEC_H */
diff --git a/include/osmocom/core/conv.h b/include/osmocom/core/conv.h
index 4cc791f..e7f6bd6 100644
--- a/include/osmocom/core/conv.h
+++ b/include/osmocom/core/conv.h
@@ -28,8 +28,7 @@
* Osmocom convolutional encoder and decoder
*/
-#ifndef __OSMO_CONV_H__
-#define __OSMO_CONV_H__
+#pragma once
#include <stdint.h>
@@ -142,5 +141,3 @@
/*! @} */
-
-#endif /* __OSMO_CONV_H__ */
diff --git a/include/osmocom/core/crc16.h b/include/osmocom/core/crc16.h
index 0e52417..83b2e5f 100644
--- a/include/osmocom/core/crc16.h
+++ b/include/osmocom/core/crc16.h
@@ -15,8 +15,7 @@
* Version 2. See the file COPYING for more details.
*/
-#ifndef __CRC16_H
-#define __CRC16_H
+#pragma once
#include <stdint.h>
@@ -30,5 +29,3 @@
{
return (crc >> 8) ^ osmo_crc16_table[(crc ^ data) & 0xff];
}
-
-#endif /* __CRC16_H */
diff --git a/include/osmocom/core/crcXXgen.h.tpl b/include/osmocom/core/crcXXgen.h.tpl
index a931bc3..164f720 100644
--- a/include/osmocom/core/crcXXgen.h.tpl
+++ b/include/osmocom/core/crcXXgen.h.tpl
@@ -20,8 +20,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __OSMO_CRCXXGEN_H__
-#define __OSMO_CRCXXGEN_H__
+#pragma once
/*! \addtogroup crcgen
* @{
@@ -54,6 +53,4 @@
/*! @} */
-#endif /* __OSMO_CRCXXGEN_H__ */
-
/* vim: set syntax=c: */
diff --git a/include/osmocom/core/crcgen.h b/include/osmocom/core/crcgen.h
index 69cef04..b39b55d 100644
--- a/include/osmocom/core/crcgen.h
+++ b/include/osmocom/core/crcgen.h
@@ -20,8 +20,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __OSMO_CRCGEN_H__
-#define __OSMO_CRCGEN_H__
+#pragma once
/*! \defgroup crcgen Osmocom generic CRC routines
* @{
@@ -37,5 +36,3 @@
#include <osmocom/core/crc64gen.h>
/*! @} */
-
-#endif /* __OSMO_CRCGEN_H__ */
diff --git a/include/osmocom/core/defs.h b/include/osmocom/core/defs.h
index 5ffee04..aebe925 100644
--- a/include/osmocom/core/defs.h
+++ b/include/osmocom/core/defs.h
@@ -1,5 +1,4 @@
-#ifndef OSMOCORE_DEFS_H
-#define OSMOCORE_DEFS_H
+#pragma once
/*! \defgroup utils General-purpose utility functions
* @{
@@ -46,5 +45,3 @@
#undef _OSMO_HAS_ATTRIBUTE_DEPRECATED
/*! @} */
-
-#endif
diff --git a/include/osmocom/core/gsmtap.h b/include/osmocom/core/gsmtap.h
index 4694219..69bd108 100644
--- a/include/osmocom/core/gsmtap.h
+++ b/include/osmocom/core/gsmtap.h
@@ -1,5 +1,4 @@
-#ifndef _GSMTAP_H
-#define _GSMTAP_H
+#pragma once
/* gsmtap header, pseudo-header in front of the actua GSM payload */
@@ -239,5 +238,3 @@
uint8_t res; /* reserved for future use (RFU) */
} __attribute__((packed));
-
-#endif /* _GSMTAP_H */
diff --git a/include/osmocom/core/gsmtap_util.h b/include/osmocom/core/gsmtap_util.h
index eaa32a0..a5c03e7 100644
--- a/include/osmocom/core/gsmtap_util.h
+++ b/include/osmocom/core/gsmtap_util.h
@@ -1,5 +1,4 @@
-#ifndef _GSMTAP_UTIL_H
-#define _GSMTAP_UTIL_H
+#pragma once
#include <stdint.h>
#include <osmocom/core/write_queue.h>
@@ -55,5 +54,3 @@
unsigned int len);
/*! @} */
-
-#endif /* _GSMTAP_UTIL_H */
diff --git a/include/osmocom/core/linuxlist.h b/include/osmocom/core/linuxlist.h
index fb99c5e..b684152 100644
--- a/include/osmocom/core/linuxlist.h
+++ b/include/osmocom/core/linuxlist.h
@@ -1,5 +1,4 @@
-#ifndef _LINUX_LLIST_H
-#define _LINUX_LLIST_H
+#pragma once
#include <stddef.h>
@@ -355,6 +354,3 @@
#define llist_for_each_continue_rcu(pos, head) \
for ((pos) = (pos)->next, prefetch((pos)->next); (pos) != (head); \
(pos) = (pos)->next, ({ smp_read_barrier_depends(); 0;}), prefetch((pos)->next))
-
-
-#endif
diff --git a/include/osmocom/core/linuxrbtree.h b/include/osmocom/core/linuxrbtree.h
index 079f440..ef8bc15 100644
--- a/include/osmocom/core/linuxrbtree.h
+++ b/include/osmocom/core/linuxrbtree.h
@@ -91,8 +91,7 @@
-----------------------------------------------------------------------
*/
-#ifndef _LINUX_RBTREE_H
-#define _LINUX_RBTREE_H
+#pragma once
#include <stdlib.h>
@@ -156,5 +155,3 @@
*rb_link = node;
}
-
-#endif /* _LINUX_RBTREE_H */
diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h
index 1d57e22..caeea06 100644
--- a/include/osmocom/core/logging.h
+++ b/include/osmocom/core/logging.h
@@ -1,5 +1,4 @@
-#ifndef _OSMOCORE_LOGGING_H
-#define _OSMOCORE_LOGGING_H
+#pragma once
/*! \defgroup logging Osmocom logging framework
* @{
@@ -216,5 +215,3 @@
extern struct llist_head osmo_log_target_list;
/*! @} */
-
-#endif /* _OSMOCORE_LOGGING_H */
diff --git a/include/osmocom/core/loggingrb.h b/include/osmocom/core/loggingrb.h
index a6f377b..acdccfb 100644
--- a/include/osmocom/core/loggingrb.h
+++ b/include/osmocom/core/loggingrb.h
@@ -1,5 +1,4 @@
-#ifndef _LOGGINGRB_H
-#define _LOGGINGRB_H
+#pragma once
/* (C) 2012-2013 by Katerina Barone-Adesi <kat.obsc@gmail.com>
* All Rights Reserved
@@ -36,5 +35,3 @@
struct log_target *log_target_create_rb(size_t size);
/*! @} */
-
-#endif /* _LOGGINGRB_H */
diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h
index 33e8081..bf83d67 100644
--- a/include/osmocom/core/msgb.h
+++ b/include/osmocom/core/msgb.h
@@ -1,5 +1,4 @@
-#ifndef _MSGB_H
-#define _MSGB_H
+#pragma once
/* (C) 2008 by Harald Welte <laforge@gnumonks.org>
* All Rights Reserved
@@ -413,5 +412,3 @@
void msgb_set_talloc_ctx(void *ctx);
/*! @} */
-
-#endif /* _MSGB_H */
diff --git a/include/osmocom/core/msgfile.h b/include/osmocom/core/msgfile.h
index c5e67a4..cab97b2 100644
--- a/include/osmocom/core/msgfile.h
+++ b/include/osmocom/core/msgfile.h
@@ -19,8 +19,7 @@
*
*/
-#ifndef MSG_FILE_H
-#define MSG_FILE_H
+#pragma once
#include <osmocom/core/linuxlist.h>
@@ -45,5 +44,3 @@
};
struct osmo_config_list* osmo_config_list_parse(void *ctx, const char *filename);
-
-#endif
diff --git a/include/osmocom/core/panic.h b/include/osmocom/core/panic.h
index fd5cf20..5d575c4 100644
--- a/include/osmocom/core/panic.h
+++ b/include/osmocom/core/panic.h
@@ -1,5 +1,4 @@
-#ifndef OSMOCORE_PANIC_H
-#define OSMOCORE_PANIC_H
+#pragma once
/*! \addtogroup utils
* @{
@@ -16,5 +15,3 @@
extern void osmo_set_panic_handler(osmo_panic_handler_t h);
/*! @} */
-
-#endif /* OSMOCORE_PANIC_H */
diff --git a/include/osmocom/core/plugin.h b/include/osmocom/core/plugin.h
index 6c0eccc..aef1dfc 100644
--- a/include/osmocom/core/plugin.h
+++ b/include/osmocom/core/plugin.h
@@ -1,6 +1,3 @@
-#ifndef _OSMO_PLUGIN_H
-#define _OSMO_PLUGIN_H
+#pragma once
int osmo_plugin_load_all(const char *directory);
-
-#endif
diff --git a/include/osmocom/core/prim.h b/include/osmocom/core/prim.h
index f61d808..935ce51 100644
--- a/include/osmocom/core/prim.h
+++ b/include/osmocom/core/prim.h
@@ -1,5 +1,4 @@
-#ifndef OSMO_PRIMITIVE_H
-#define OSMO_PRIMITIVE_H
+#pragma once
/*! \defgroup prim Osmocom primitives
* @{
@@ -56,5 +55,3 @@
typedef int (*osmo_prim_cb)(struct osmo_prim_hdr *oph, void *ctx);
/*! @} */
-
-#endif /* OSMO_PRIMITIVE_H */
diff --git a/include/osmocom/core/rate_ctr.h b/include/osmocom/core/rate_ctr.h
index 24577fd..821c7cf 100644
--- a/include/osmocom/core/rate_ctr.h
+++ b/include/osmocom/core/rate_ctr.h
@@ -1,5 +1,4 @@
-#ifndef _RATE_CTR_H
-#define _RATE_CTR_H
+#pragma once
/*! \defgroup rate_ctr Rate counters
* @{
@@ -85,4 +84,3 @@
const struct rate_ctr *rate_ctr_get_by_name(const struct rate_ctr_group *ctrg, const char *name);
/*! @} */
-#endif /* RATE_CTR_H */
diff --git a/include/osmocom/core/select.h b/include/osmocom/core/select.h
index efdd716..b6b9e82 100644
--- a/include/osmocom/core/select.h
+++ b/include/osmocom/core/select.h
@@ -1,5 +1,4 @@
-#ifndef _BSC_SELECT_H
-#define _BSC_SELECT_H
+#pragma once
#include <osmocom/core/linuxlist.h>
@@ -41,5 +40,3 @@
int osmo_select_main(int polling);
/*! @} */
-
-#endif /* _BSC_SELECT_H */
diff --git a/include/osmocom/core/serial.h b/include/osmocom/core/serial.h
index 1640a6d..e3f7a9f 100644
--- a/include/osmocom/core/serial.h
+++ b/include/osmocom/core/serial.h
@@ -28,8 +28,7 @@
* Osmocom serial port helpers
*/
-#ifndef __OSMO_SERIAL_H__
-#define __OSMO_SERIAL_H__
+#pragma once
#include <termios.h>
@@ -39,5 +38,3 @@
int osmo_serial_clear_custom_baudrate(int fd);
/*! @} */
-
-#endif /* __OSMO_SERIAL_H__ */
diff --git a/include/osmocom/core/signal.h b/include/osmocom/core/signal.h
index 19a2688..6f56496 100644
--- a/include/osmocom/core/signal.h
+++ b/include/osmocom/core/signal.h
@@ -1,5 +1,4 @@
-#ifndef OSMO_SIGNAL_H
-#define OSMO_SIGNAL_H
+#pragma once
#include <stdint.h>
@@ -43,5 +42,3 @@
void osmo_signal_dispatch(unsigned int subsys, unsigned int signal, void *signal_data);
/*! @} */
-
-#endif /* OSMO_SIGNAL_H */
diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h
index cb1b7a8..1df28c9 100644
--- a/include/osmocom/core/socket.h
+++ b/include/osmocom/core/socket.h
@@ -1,5 +1,4 @@
-#ifndef _OSMOCORE_SOCKET_H
-#define _OSMOCORE_SOCKET_H
+#pragma once
/*! \defgroup socket Socket convenience functions
* @{
@@ -37,5 +36,3 @@
const char *socket_path, unsigned int flags);
/*! @} */
-
-#endif /* _OSMOCORE_SOCKET_H */
diff --git a/include/osmocom/core/statistics.h b/include/osmocom/core/statistics.h
index ade0074..de250be 100644
--- a/include/osmocom/core/statistics.h
+++ b/include/osmocom/core/statistics.h
@@ -1,5 +1,4 @@
-#ifndef _STATISTICS_H
-#define _STATISTICS_H
+#pragma once
/*! \file statistics.h
* \brief Common routines regarding statistics */
@@ -49,5 +48,3 @@
* \returns pointer to counter (\ref osmo_counter) or NULL otherwise
*/
struct osmo_counter *osmo_counter_get_by_name(const char *name);
-
-#endif /* _STATISTICS_H */
diff --git a/include/osmocom/core/strrb.h b/include/osmocom/core/strrb.h
index cfc56dc..c563d1b 100644
--- a/include/osmocom/core/strrb.h
+++ b/include/osmocom/core/strrb.h
@@ -1,5 +1,4 @@
-#ifndef _STRRB_H
-#define _STRRB_H
+#pragma once
/* (C) 2012-2013 by Katerina Barone-Adesi <kat.obsc@gmail.com>
* All Rights Reserved
@@ -54,5 +53,3 @@
int osmo_strrb_add(struct osmo_strrb *rb, const char *data);
/*! @} */
-
-#endif /* _STRRB_H */
diff --git a/include/osmocom/core/talloc.h b/include/osmocom/core/talloc.h
index f7f7643..dde102b 100644
--- a/include/osmocom/core/talloc.h
+++ b/include/osmocom/core/talloc.h
@@ -1,5 +1,4 @@
-#ifndef _TALLOC_H_
-#define _TALLOC_H_
+#pragma once
/*
Unix SMB/CIFS implementation.
Samba temporary memory allocation functions
@@ -188,5 +187,3 @@
char *talloc_asprintf_append_buffer(char *s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
void talloc_set_abort_fn(void (*abort_fn)(const char *reason));
-
-#endif
diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h
index d37af80..d734357 100644
--- a/include/osmocom/core/timer.h
+++ b/include/osmocom/core/timer.h
@@ -26,8 +26,7 @@
* \brief Osmocom timer handling routines
*/
-#ifndef TIMER_H
-#define TIMER_H
+#pragma once
#include <sys/time.h>
@@ -85,5 +84,3 @@
int osmo_timers_check(void);
/*! @} */
-
-#endif
diff --git a/include/osmocom/core/timer_compat.h b/include/osmocom/core/timer_compat.h
index d86c109..fb2967b 100644
--- a/include/osmocom/core/timer_compat.h
+++ b/include/osmocom/core/timer_compat.h
@@ -26,8 +26,7 @@
* \brief Compatibility header with some helpers
*/
-#ifndef TIMER_COMPAT_H
-#define TIMER_COMPAT_H
+#pragma once
/* Convenience macros for operations on timevals.
@@ -75,5 +74,3 @@
/*! @} */
-
-#endif /* TIMER_COMPAT_H */
diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h
index 2333de6..c08e775 100644
--- a/include/osmocom/core/utils.h
+++ b/include/osmocom/core/utils.h
@@ -1,5 +1,4 @@
-#ifndef OSMOCORE_UTIL_H
-#define OSMOCORE_UTIL_H
+#pragma once
#include <osmocom/core/backtrace.h>
@@ -62,5 +61,3 @@
/*! @} */
-
-#endif
diff --git a/include/osmocom/core/write_queue.h b/include/osmocom/core/write_queue.h
index 816c036..4e0fdf3 100644
--- a/include/osmocom/core/write_queue.h
+++ b/include/osmocom/core/write_queue.h
@@ -20,8 +20,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
-#ifndef OSMO_WQUEUE_H
-#define OSMO_WQUEUE_H
+#pragma once
/*! \defgroup write_queue Osmocom msgb write queues
* @{
@@ -59,5 +58,3 @@
int osmo_wqueue_bfd_cb(struct osmo_fd *fd, unsigned int what);
/*! @} */
-
-#endif