[sysprof: 14/63] libsysprof-capture: Replace G_GNUC_INTERNAL with SYSPROF_INTERNAL



commit c9f54fcc68d2dc82a12b9e9a55043cd699fe4361
Author: Philip Withnall <withnall endlessm com>
Date:   Wed Jul 1 16:41:52 2020 +0100

    libsysprof-capture: Replace G_GNUC_INTERNAL with SYSPROF_INTERNAL
    
    It does the same thing for modern compilers.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    Helps: #40

 src/libsysprof-capture/mapped-ring-buffer.h     | 22 +++++++++++-----------
 src/libsysprof-capture/sysprof-capture-writer.h | 11 +++++------
 src/libsysprof-capture/sysprof-macros.h         |  6 ++++++
 3 files changed, 22 insertions(+), 17 deletions(-)
---
diff --git a/src/libsysprof-capture/mapped-ring-buffer.h b/src/libsysprof-capture/mapped-ring-buffer.h
index 5e2df52..eb2c6ca 100644
--- a/src/libsysprof-capture/mapped-ring-buffer.h
+++ b/src/libsysprof-capture/mapped-ring-buffer.h
@@ -57,31 +57,31 @@ typedef bool (*MappedRingBufferCallback) (const void    *data,
                                           size_t        *length,
                                           void          *user_data);
 
-G_GNUC_INTERNAL
+SYSPROF_INTERNAL
 MappedRingBuffer *mapped_ring_buffer_new_reader         (size_t                    buffer_size);
-G_GNUC_INTERNAL
+SYSPROF_INTERNAL
 MappedRingBuffer *mapped_ring_buffer_new_readwrite      (size_t                    buffer_size);
-G_GNUC_INTERNAL
+SYSPROF_INTERNAL
 MappedRingBuffer *mapped_ring_buffer_new_writer         (int                       fd);
-G_GNUC_INTERNAL
+SYSPROF_INTERNAL
 int               mapped_ring_buffer_get_fd             (MappedRingBuffer         *self);
-G_GNUC_INTERNAL
+SYSPROF_INTERNAL
 MappedRingBuffer *mapped_ring_buffer_ref                (MappedRingBuffer         *self);
-G_GNUC_INTERNAL
+SYSPROF_INTERNAL
 void              mapped_ring_buffer_unref              (MappedRingBuffer         *self);
-G_GNUC_INTERNAL
+SYSPROF_INTERNAL
 void              mapped_ring_buffer_clear              (MappedRingBuffer         *self);
-G_GNUC_INTERNAL
+SYSPROF_INTERNAL
 void             *mapped_ring_buffer_allocate           (MappedRingBuffer         *self,
                                                          size_t                    length);
-G_GNUC_INTERNAL
+SYSPROF_INTERNAL
 void              mapped_ring_buffer_advance            (MappedRingBuffer         *self,
                                                          size_t                    length);
-G_GNUC_INTERNAL
+SYSPROF_INTERNAL
 bool              mapped_ring_buffer_drain              (MappedRingBuffer         *self,
                                                          MappedRingBufferCallback  callback,
                                                          void                     *user_data);
-G_GNUC_INTERNAL
+SYSPROF_INTERNAL
 bool              mapped_ring_buffer_is_empty           (MappedRingBuffer         *self);
 
 SYSPROF_END_DECLS
diff --git a/src/libsysprof-capture/sysprof-capture-writer.h b/src/libsysprof-capture/sysprof-capture-writer.h
index cc43090..c6c3150 100644
--- a/src/libsysprof-capture/sysprof-capture-writer.h
+++ b/src/libsysprof-capture/sysprof-capture-writer.h
@@ -240,17 +240,16 @@ SYSPROF_AVAILABLE_IN_ALL
 bool                  sysprof_capture_writer_cat                             (SysprofCaptureWriter           
   *self,
                                                                               SysprofCaptureReader           
   *reader,
                                                                               GError                         
  **error);
-G_GNUC_INTERNAL
+SYSPROF_INTERNAL
 bool                  _sysprof_capture_writer_add_raw                        (SysprofCaptureWriter           
   *self,
                                                                               const SysprofCaptureFrame      
   *frame);
-G_GNUC_INTERNAL
+SYSPROF_INTERNAL
 bool                  _sysprof_capture_writer_splice_from_fd                 (SysprofCaptureWriter           
   *self,
                                                                               int                            
    fd,
-                                                                              GError                         
  **error) G_GNUC_INTERNAL;
-G_GNUC_INTERNAL
+                                                                              GError                         
  **error) SYSPROF_INTERNAL;
+SYSPROF_INTERNAL
 bool                  _sysprof_capture_writer_set_time_range                 (SysprofCaptureWriter           
   *self,
                                                                               int64_t                        
    start_time,
-                                                                              int64_t                        
    end_time) G_GNUC_INTERNAL;
-
+                                                                              int64_t                        
    end_time) SYSPROF_INTERNAL;
 
 SYSPROF_END_DECLS
diff --git a/src/libsysprof-capture/sysprof-macros.h b/src/libsysprof-capture/sysprof-macros.h
index d5fd732..241a41e 100644
--- a/src/libsysprof-capture/sysprof-macros.h
+++ b/src/libsysprof-capture/sysprof-macros.h
@@ -66,3 +66,9 @@
 #define SYSPROF_BEGIN_DECLS
 #define SYSPROF_END_DECLS
 #endif
+
+#if defined (__GNUC__)
+#define SYSPROF_INTERNAL __attribute__((visibility("hidden")))
+#else
+#define SYSPROF_INTERNAL
+#endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]