]> granicus.if.org Git - gc/commitdiff
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 94dd4de4f386b766fd681b6482c9900e93f109e2..1716c8871c3517fff54e544efd753740fcb9e4dc 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 3e2e6d5974aee21b4f4fdcd86bb7208cc92adc06..14c7710d4ec9b5def9cbeb9f2d756a037d132a71 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 c6d67c3c8a3087b1197d6572a277e41a52fe45c9..1b030bc4dd619f85a7fab02ada1d248b2ecb98d8 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 092d34151dfe27ee3731c90716753e06accfeb31..683d4adab48f4b18d9d72583ca9b614bc239b138 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" */