Commit c2f1db8f authored by Shawn Landden's avatar Shawn Landden Committed by Lennart Poettering
Browse files

use #pragma once instead of foo*foo #define guards

 #pragma once has been "un-deprecated" in gcc since 3.3, and is widely supported
in other compilers.

I've been using and maintaining (rebasing) this patch for a while now, as
it annoyed me to see #ifndef fooblahfoo, etc all over the place,
almost arrogant about the annoyance of having to define all these names to
perform a commen but neccicary functionality, when a completely superior
alternative exists.

I havn't sent it till now, cause its kindof a style change, and it is bad
voodoo to mess with style that has been established by more established
editors. So feel free to lambast me as a crazy bafoon.

v2 - preserve externally used headers
parent 4a842cad
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef fooautomounthfoo
#define fooautomounthfoo
#pragma once
/***
This file is part of systemd.
......@@ -72,5 +71,3 @@ AutomountState automount_state_from_string(const char *s);
const char* automount_result_to_string(AutomountResult i);
AutomountResult automount_result_from_string(const char *s);
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foobuildhfoo
#define foobuildhfoo
#pragma once
/***
This file is part of systemd.
......@@ -65,5 +64,3 @@
#endif
#define SYSTEMD_FEATURES _PAM_FEATURE_ " " _LIBWRAP_FEATURE_ " " _AUDIT_FEATURE_ " " _SELINUX_FEATURE_ " " _IMA_FEATURE_ " " _SYSVINIT_FEATURE_ " " _LIBCRYPTSETUP_FEATURE_
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foobuserrorshfoo
#define foobuserrorshfoo
#pragma once
/***
This file is part of systemd.
......@@ -54,5 +53,3 @@ static inline const char *bus_error(const DBusError *e, int r) {
return strerror(-r);
}
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foocgroupattrhfoo
#define foocgroupattrhfoo
#pragma once
/***
This file is part of systemd.
......@@ -45,5 +44,3 @@ int cgroup_attribute_apply_list(CGroupAttribute *first, CGroupBonding *b);
CGroupAttribute *cgroup_attribute_find_list(CGroupAttribute *first, const char *controller, const char *name);
void cgroup_attribute_free_list(CGroupAttribute *first);
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foocgrouphfoo
#define foocgrouphfoo
#pragma once
/***
This file is part of systemd.
......@@ -90,5 +89,3 @@ int cgroup_bonding_get(Manager *m, const char *cgroup, CGroupBonding **bonding);
int cgroup_notify_empty(Manager *m, const char *group);
Unit* cgroup_unit_by_pid(Manager *m, pid_t pid);
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef fooconditionhfoo
#define fooconditionhfoo
#pragma once
/***
This file is part of systemd.
......@@ -66,5 +65,3 @@ void condition_dump_list(Condition *c, FILE *f, const char *prefix);
const char* condition_type_to_string(ConditionType t);
int condition_type_from_string(const char *s);
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foodbusautomounthfoo
#define foodbusautomounthfoo
#pragma once
/***
This file is part of systemd.
......@@ -30,5 +29,3 @@ DBusHandlerResult bus_automount_message_handler(Unit *u, DBusConnection *c, DBus
extern const char bus_automount_interface[];
extern const char bus_automount_invalidating_properties[];
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foodbusdevicehfoo
#define foodbusdevicehfoo
#pragma once
/***
This file is part of systemd.
......@@ -30,5 +29,3 @@ DBusHandlerResult bus_device_message_handler(Unit *u, DBusConnection *c, DBusMes
extern const char bus_device_interface[];
extern const char bus_device_invalidating_properties[];
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foodbusexecutehfoo
#define foodbusexecutehfoo
#pragma once
/***
This file is part of systemd.
......@@ -124,5 +123,3 @@ int bus_execute_append_command(DBusMessageIter *u, const char *property, void *d
int bus_execute_append_kill_mode(DBusMessageIter *i, const char *property, void *data);
int bus_execute_append_env_files(DBusMessageIter *i, const char *property, void *data);
int bus_execute_append_syscall_filter(DBusMessageIter *i, const char *property, void *data);
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foodbusjobhfoo
#define foodbusjobhfoo
#pragma once
/***
This file is part of systemd.
......@@ -32,5 +31,3 @@ void bus_job_send_removed_signal(Job *j);
extern const DBusObjectPathVTable bus_job_vtable;
extern const char bus_job_interface[];
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foodbusmanagerhfoo
#define foodbusmanagerhfoo
#pragma once
/***
This file is part of systemd.
......@@ -27,5 +26,3 @@
extern const DBusObjectPathVTable bus_manager_vtable;
extern const char bus_manager_interface[];
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foodbusmounthfoo
#define foodbusmounthfoo
#pragma once
/***
This file is part of systemd.
......@@ -30,5 +29,3 @@ DBusHandlerResult bus_mount_message_handler(Unit *u, DBusConnection *c, DBusMess
extern const char bus_mount_interface[];
extern const char bus_mount_invalidating_properties[];
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foodbuspathhfoo
#define foodbuspathhfoo
#pragma once
/***
This file is part of systemd.
......@@ -31,5 +30,3 @@ DBusHandlerResult bus_path_message_handler(Unit *u, DBusConnection *c, DBusMessa
extern const char bus_path_interface[];
extern const char bus_path_invalidating_properties[];
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foodbusservicehfoo
#define foodbusservicehfoo
#pragma once
/***
This file is part of systemd.
......@@ -30,5 +29,3 @@ DBusHandlerResult bus_service_message_handler(Unit *u, DBusConnection *c, DBusMe
extern const char bus_service_interface[];
extern const char bus_service_invalidating_properties[];
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foodbussnapshothfoo
#define foodbussnapshothfoo
#pragma once
/***
This file is part of systemd.
......@@ -29,5 +28,3 @@
DBusHandlerResult bus_snapshot_message_handler(Unit *u, DBusConnection *c, DBusMessage *message);
extern const char bus_snapshot_interface[];
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foodbussockethfoo
#define foodbussockethfoo
#pragma once
/***
This file is part of systemd.
......@@ -30,5 +29,3 @@ DBusHandlerResult bus_socket_message_handler(Unit *u, DBusConnection *c, DBusMes
extern const char bus_socket_interface[];
extern const char bus_socket_invalidating_properties[];
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foodbusswaphfoo
#define foodbusswaphfoo
#pragma once
/***
This file is part of systemd.
......@@ -31,5 +30,3 @@ DBusHandlerResult bus_swap_message_handler(Unit *u, DBusConnection *c, DBusMessa
extern const char bus_swap_interface[];
extern const char bus_swap_invalidating_properties[];
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foodbustargethfoo
#define foodbustargethfoo
#pragma once
/***
This file is part of systemd.
......@@ -29,5 +28,3 @@
DBusHandlerResult bus_target_message_handler(Unit *u, DBusConnection *c, DBusMessage *message);
extern const char bus_target_interface[];
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foodbustimerhfoo
#define foodbustimerhfoo
#pragma once
/***
This file is part of systemd.
......@@ -30,5 +29,3 @@ DBusHandlerResult bus_timer_message_handler(Unit *u, DBusConnection *c, DBusMess
extern const char bus_timer_interface[];
extern const char bus_timer_invalidating_properties[];
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foodbusunithfoo
#define foodbusunithfoo
#pragma once
/***
This file is part of systemd.
......@@ -138,5 +137,3 @@ void bus_unit_send_removed_signal(Unit *u);
extern const DBusObjectPathVTable bus_unit_vtable;
extern const char bus_unit_interface[];
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment