Skip to content

Commit 748b8ee

Browse files
committed
Remove ANSI-C support
1 parent 7888996 commit 748b8ee

96 files changed

Lines changed: 1106 additions & 1466 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

inc/mx.h renamed to inc/mx.hpp

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,16 @@
2525
*/
2626

2727

28-
#ifndef MXCPP_H_INCLUDE_GUARD
29-
#define MXCPP_H_INCLUDE_GUARD
28+
#ifndef MXCPP_HPP_INCLUDE_GUARD
29+
#define MXCPP_HPP_INCLUDE_GUARD
3030

3131

32-
/* C and C++ headers. */
33-
34-
#include "mx/sysdefs.h"
35-
#include "mx/types.h"
36-
37-
#include "mx/debug.h"
38-
39-
40-
#ifdef __cplusplus
41-
// C++ only headers.
32+
#include "mx/sysdefs.hpp"
33+
#include "mx/types.hpp"
4234

4335
// Core library headers.
4436
#include "mx/Except.hpp"
37+
#include "mx/Debug.hpp"
4538
#include "mx/Memory.hpp"
4639
#include "mx/Stream.hpp"
4740
#include "mx/FileStrm.hpp"
@@ -51,9 +44,6 @@
5144
#include "mx/System/Error.hpp"
5245

5346

54-
#endif /* __cplusplus */
55-
56-
57-
#endif /* MXCPP_H_INCLUDE_GUARD*/
47+
#endif // MXCPP_HPP_INCLUDE_GUARD
5848

5949
/* EOF */

inc/mx/App/App.hpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,11 @@
2929
#define MXCPP_APPLICATION_HPP_INCLUDE_GUARD
3030

3131

32-
#ifndef __cplusplus
33-
#error This header file requires C++ to compile!
34-
#endif
35-
36-
37-
#include "mx/sysdefs.h"
32+
#include "mx/sysdefs.hpp"
3833

39-
#include "mx/types.h"
34+
#include "mx/types.hpp"
4035

41-
#include "mx/debug.h"
36+
#include "mx/Debug.hpp"
4237

4338
#include "mx/Except.hpp"
4439

inc/mx/Class.hpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,9 @@
2929
#define MXCPP_CLASSBASE_HPP_INCLUDE_GUARD
3030

3131

32-
#ifndef __cplusplus
33-
#error This header file requires C++ to compile!
34-
#endif
35-
36-
37-
#include "mx/sysdefs.h"
32+
#include "mx/sysdefs.hpp"
3833

39-
#include "mx/types.h"
34+
#include "mx/types.hpp"
4035

4136

4237
namespace mx
@@ -53,7 +48,7 @@ class MXCPP_DLL_EXPORT Class
5348

5449
public:
5550

56-
virtual ~Class();
51+
virtual MX_INLINE ~Class();
5752

5853
// Class instance methods.
5954

inc/mx/Class.inl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,8 @@
2525
*/
2626

2727

28+
/* virtual */ MX_INLINE mx::Class::~Class()
29+
{}
30+
31+
2832
/* EOF */

inc/mx/debug.h renamed to inc/mx/Debug.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
*/
2626

2727

28-
#ifndef MXCPP_DEBUG_H_INCLUDE_GUARD
29-
#define MXCPP_DEBUG_H_INCLUDE_GUARD
28+
#ifndef MXCPP_DEBUG_HPP_INCLUDE_GUARD
29+
#define MXCPP_DEBUG_HPP_INCLUDE_GUARD
3030

3131

32-
#include "mx/sysdefs.h"
32+
#include "mx/sysdefs.hpp"
3333

34-
#include "mx/types.h"
34+
#include "mx/types.hpp"
3535

3636

3737
#define mxAssert(condition)
@@ -43,9 +43,9 @@
4343

4444
// Define inline methods here if inlining is enabled.
4545
#ifdef MX_INLINE_ENABLED
46-
#include "mx/debug.inl"
46+
#include "mx/Debug.inl"
4747
#endif
4848

49-
#endif /* MXCPP_DEBUG_H_INCLUDE_GUARD */
49+
#endif /* MXCPP_DEBUG_HPP_INCLUDE_GUARD */
5050

5151
/* EOF */

inc/mx/Except.hpp

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,9 @@
2929
#define MXCPP_EXCEPTION_HPP_INCLUDE_GUARD
3030

3131

32-
#ifndef __cplusplus
33-
#error This header file requires C++ to compile!
34-
#endif
35-
32+
#include "mx/sysdefs.hpp"
3633

37-
#include "mx/sysdefs.h"
38-
39-
#include "mx/types.h"
34+
#include "mx/types.hpp"
4035

4136
#include "mx/Class.hpp"
4237

@@ -45,38 +40,14 @@ namespace mx
4540
{
4641

4742

48-
#define mxThrow(exception) \
49-
mx::ThrowException(exception, __FILE__, static_cast< Size >(__LINE__))
43+
#define Throw(exception) \
44+
ThrowException(exception, __FILE__, static_cast< FileLine >(__LINE__))
5045

5146

5247
// Forward declaration.
5348
class Stream;
5449

5550

56-
#ifdef MXCPP_FIX_NO_STD_EXCEPTION
57-
58-
// For compilers which does not have std::exception classes declared.
59-
namespace std
60-
{
61-
62-
class exception
63-
{
64-
/*
65-
public:
66-
*/
67-
};
68-
69-
70-
class bad_alloc
71-
: public exception
72-
{};
73-
74-
75-
}
76-
77-
#endif // MXCPP_FIX_NO_STD_EXCEPTION
78-
79-
8051
/**
8152
Exception class declaration.
8253
@@ -234,7 +205,7 @@ class MXCPP_DLL_EXPORT Exception
234205

235206
MX_INLINE void SetDebugInfo(
236207
const char * const sFileName,
237-
const Size iFileLine) const;
208+
const FileLine iFileLine) const;
238209

239210
protected:
240211

@@ -254,7 +225,7 @@ class MXCPP_DLL_EXPORT Exception
254225
mutable const char * m_sFileName;
255226

256227
/// Line number in the source file, where the exception was raised.
257-
mutable Size m_iFileLine;
228+
mutable FileLine m_iFileLine;
258229

259230

260231
}; // class Exception
@@ -307,7 +278,7 @@ template< class ExceptionType >
307278
static MX_NORETURN ThrowException(
308279
const ExceptionType & pException,
309280
const char * const sFileName,
310-
const Size iFileLine)
281+
const FileLine iFileLine)
311282
{
312283
// Setup the exception using Exception typed reference, to allow setting
313284
// of its private members.

inc/mx/Except.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ MX_INLINE mx::Exception::Exception(
5757

5858
MX_INLINE void mx::Exception::SetDebugInfo(
5959
const char * const sFileName,
60-
const Size iFileLine) const
60+
const FileLine iFileLine) const
6161
{
6262
m_sFileName = sFileName;
6363
m_iFileLine = iFileLine;

inc/mx/FileStrm.hpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,9 @@
2929
#define MXCPP_FILE_STREAM_HPP_INCLUDE_GUARD
3030

3131

32-
#ifndef __cplusplus
33-
#error This header file requires C++ to compile!
34-
#endif
35-
36-
37-
#include "mx/sysdefs.h"
32+
#include "mx/sysdefs.hpp"
3833

39-
#include "mx/types.h"
34+
#include "mx/types.hpp"
4035

4136
#include "mx/Stream.hpp"
4237

0 commit comments

Comments
 (0)