diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2018-02-28 09:40:27 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-02-28 13:53:07 +0300 |
commit | c6ea1f66fe335c303f9ce73319d24247bc504304 (patch) | |
tree | a2babf479077aa0737ffe9732100314315ba7f29 /extra | |
parent | e2a83ff4ab70eef5b16fabd8e441828b419ceb58 (diff) | |
download | bdwgc-c6ea1f66fe335c303f9ce73319d24247bc504304.tar.gz |
Remove a redundant check of __cplusplus in Symbian-specific .cpp files
(code refactoring)
* extra/symbian.cpp: Remove "#ifdef __cplusplus" as the latter should
be defined (by default) in case of .cpp file.
* extra/symbian/global_end.cpp: Likewise.
* extra/symbian/global_start.cpp: Likewise.
* extra/symbian/init_global_static_roots.cpp: Likewise.
* extra/symbian/init_global_static_roots.cpp
(GC_init_global_static_roots): Adjust indentation.
Diffstat (limited to 'extra')
-rw-r--r-- | extra/symbian.cpp | 14 | ||||
-rw-r--r-- | extra/symbian/global_end.cpp | 8 | ||||
-rw-r--r-- | extra/symbian/global_start.cpp | 8 | ||||
-rw-r--r-- | extra/symbian/init_global_static_roots.cpp | 31 |
4 files changed, 20 insertions, 41 deletions
diff --git a/extra/symbian.cpp b/extra/symbian.cpp index 94dd4de4..1716c887 100644 --- a/extra/symbian.cpp +++ b/extra/symbian.cpp @@ -6,12 +6,10 @@ #include <stdlib.h> #include <string.h> -#ifdef __cplusplus extern "C" { -#endif int GC_get_main_symbian_stack_base() - { +{ TThreadStackInfo aInfo; TInt err = RThread().StackInfo(aInfo); if ( !err ) @@ -22,10 +20,10 @@ int GC_get_main_symbian_stack_base() { return 0; } - } +} char* GC_get_private_path_and_zero_file() - { +{ // always on c: drive RFs fs; fs.Connect(); @@ -48,8 +46,6 @@ char* GC_get_private_path_and_zero_file() memcpy( copyChar, path8.PtrZ(), size ); return copyChar; // ownership passed - } +} -#ifdef __cplusplus - } -#endif +} /* extern "C" */ diff --git a/extra/symbian/global_end.cpp b/extra/symbian/global_end.cpp index 3e2e6d59..14c7710d 100644 --- a/extra/symbian/global_end.cpp +++ b/extra/symbian/global_end.cpp @@ -3,14 +3,8 @@ // INCLUDE FILES #include "private/gcconfig.h" -#ifdef __cplusplus extern "C" { -#endif int winscw_data_end; -#ifdef __cplusplus - } -#endif - -// End Of File +} /* extern "C" */ diff --git a/extra/symbian/global_start.cpp b/extra/symbian/global_start.cpp index c6d67c3c..1b030bc4 100644 --- a/extra/symbian/global_start.cpp +++ b/extra/symbian/global_start.cpp @@ -3,14 +3,8 @@ // INCLUDE FILES #include "private/gcconfig.h" -#ifdef __cplusplus extern "C" { -#endif int winscw_data_start; -#ifdef __cplusplus - } -#endif - -// End Of File +} /* extern "C" */ diff --git a/extra/symbian/init_global_static_roots.cpp b/extra/symbian/init_global_static_roots.cpp index 092d3415..683d4ada 100644 --- a/extra/symbian/init_global_static_roots.cpp +++ b/extra/symbian/init_global_static_roots.cpp @@ -6,28 +6,23 @@ #include "private/gcconfig.h" #include "gc.h" -#ifdef __cplusplus extern "C" { -#endif void GC_init_global_static_roots() { - ptr_t dataStart = NULL; - ptr_t dataEnd = NULL; -# if defined (__WINS__) - extern int winscw_data_start, winscw_data_end; - dataStart = ((ptr_t)&winscw_data_start); - dataEnd = ((ptr_t)&winscw_data_end); -# else - extern int Image$$RW$$Limit[], Image$$RW$$Base[]; - dataStart = ((ptr_t)Image$$RW$$Base); - dataEnd = ((ptr_t)Image$$RW$$Limit); -# endif - - GC_add_roots(dataStart, dataEnd); + ptr_t dataStart = NULL; + ptr_t dataEnd = NULL; +# if defined (__WINS__) + extern int winscw_data_start, winscw_data_end; + dataStart = ((ptr_t)&winscw_data_start); + dataEnd = ((ptr_t)&winscw_data_end); +# else + extern int Image$$RW$$Limit[], Image$$RW$$Base[]; + dataStart = ((ptr_t)Image$$RW$$Base); + dataEnd = ((ptr_t)Image$$RW$$Limit); +# endif + GC_add_roots(dataStart, dataEnd); } -#ifdef __cplusplus - } -#endif +} /* extern "C" */ |