Remove a redundant check of __cplusplus in Symbian-specific .cpp files
authorIvan Maidanski <ivmai@mail.ru>
Wed, 28 Feb 2018 06:40:27 +0000 (09:40 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 28 Feb 2018 10:53:07 +0000 (13:53 +0300)
(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.

extra/symbian.cpp
extra/symbian/global_end.cpp
extra/symbian/global_start.cpp
extra/symbian/init_global_static_roots.cpp

index 94dd4de..1716c88 100644 (file)
@@ -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" */
index 3e2e6d5..14c7710 100644 (file)
@@ -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" */
index c6d67c3..1b030bc 100644 (file)
@@ -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" */
index 092d341..683d4ad 100644 (file)
@@ -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" */