Skip to content

Commit

Permalink
Add override checking to MythSystemPrivate inheritance.
Browse files Browse the repository at this point in the history
This only works when compiling with with C++11 support, but when compiled on such
a system this will throw an error if the signature of the base class method changes
without the child class being updated.
  • Loading branch information
daniel-kristjansson committed May 23, 2013
1 parent f9c342e commit e0ff887
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
12 changes: 12 additions & 0 deletions mythtv/libs/libmythbase/mythbaseexp.h
Expand Up @@ -31,4 +31,16 @@
# define MERROR(x)
#endif

#define MOVERRIDE
#define MFINAL
#if (__cplusplus >= 201103L)
# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))) || \
(defined(__ICC) || defined(__INTEL_COMPILER))
# undef MOVERRIDE
# undef MFINAL
# define MOVERRIDE override
# define MFINAL final
# endif
#endif

#endif // MYTHBASEEXP_H_
12 changes: 6 additions & 6 deletions mythtv/libs/libmythbase/mythsystemunix.h
Expand Up @@ -86,15 +86,15 @@ class MBASE_PUBLIC MythSystemUnix : public MythSystemPrivate
MythSystemUnix(MythSystem *parent);
~MythSystemUnix();

virtual void Fork(time_t timeout);
virtual void Manage();
virtual void Fork(time_t timeout) MOVERRIDE;
virtual void Manage(void) MOVERRIDE;

virtual void Term(bool force=false);
virtual void Signal(int sig);
virtual void JumpAbort(void);
virtual void Term(bool force=false) MOVERRIDE;
virtual void Signal(int sig) MOVERRIDE;
virtual void JumpAbort(void) MOVERRIDE;

virtual bool ParseShell(const QString &cmd, QString &abscmd,
QStringList &args);
QStringList &args) MOVERRIDE;

friend class MythSystemManager;
friend class MythSystemSignalManager;
Expand Down
12 changes: 6 additions & 6 deletions mythtv/libs/libmythbase/mythsystemwindows.h
Expand Up @@ -85,15 +85,15 @@ class MBASE_PUBLIC MythSystemWindows : public MythSystemPrivate
MythSystemWindows(MythSystem *parent);
~MythSystemWindows();

virtual void Fork(time_t timeout);
virtual void Manage();
virtual void Fork(time_t timeout) MOVERRIDE;
virtual void Manage(void) MOVERRIDE;

virtual void Term(bool force=false);
virtual void Signal(int sig);
virtual void JumpAbort(void);
virtual void Term(bool force=false) MOVERRIDE;
virtual void Signal(int sig) MOVERRIDE;
virtual void JumpAbort(void) MOVERRIDE;

virtual bool ParseShell(const QString &cmd, QString &abscmd,
QStringList &args);
QStringList &args) MOVERRIDE;

friend class MythSystemManager;
friend class MythSystemSignalManager;
Expand Down

0 comments on commit e0ff887

Please sign in to comment.