chiark / gitweb /
readahead: bring export definition of sd-readahead in line with sd-daemon
authorLennart Poettering <lennart@poettering.net>
Tue, 3 Jan 2012 19:34:09 +0000 (20:34 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 3 Jan 2012 20:08:57 +0000 (21:08 +0100)
src/readahead/sd-readahead.c
src/readahead/sd-readahead.h

index c5cfe6710732c900a459510fd937aefca26ec44e..a3340666dd7326f3bcd8e0f713c563867c474d7d 100644 (file)
 
 #include "sd-readahead.h"
 
 
 #include "sd-readahead.h"
 
+#if (__GNUC__ >= 4)
+#ifdef SD_EXPORT_SYMBOLS
+/* Export symbols */
+#define _sd_export_ __attribute__ ((visibility("default")))
+#else
+/* Don't export the symbols */
+#define _sd_export_ __attribute__ ((visibility("hidden")))
+#endif
+#else
+#define _sd_export_
+#endif
+
 static int touch(const char *path) {
 
 #if !defined(DISABLE_SYSTEMD) && defined(__linux__)
 static int touch(const char *path) {
 
 #if !defined(DISABLE_SYSTEMD) && defined(__linux__)
@@ -60,7 +72,7 @@ static int touch(const char *path) {
         return 0;
 }
 
         return 0;
 }
 
-int sd_readahead(const char *action) {
+_sd_export_ int sd_readahead(const char *action) {
 
         if (!action)
                 return -EINVAL;
 
         if (!action)
                 return -EINVAL;
index 5bf975a741c1b4840ef4a3de0903256fe68cc5d6..ee7e30606e56bedb14a9da9f88b6c6d4ccc587ff 100644 (file)
@@ -56,14 +56,6 @@ extern "C" {
   See sd-readahead(7) for more information.
 */
 
   See sd-readahead(7) for more information.
 */
 
-#ifndef _sd_hidden_
-#if (__GNUC__ >= 4) && !defined(SD_EXPORT_SYMBOLS)
-#define _sd_hidden_ __attribute__ ((visibility("hidden")))
-#else
-#define _sd_hidden_
-#endif
-#endif
-
 /*
   Controls ongoing disk read-ahead operations during boot-up. The argument
   must be a string, and either "cancel", "done" or "noreplay".
 /*
   Controls ongoing disk read-ahead operations during boot-up. The argument
   must be a string, and either "cancel", "done" or "noreplay".
@@ -72,7 +64,7 @@ extern "C" {
   done = terminate read-ahead data collection, keep collected information
   noreplay = terminate read-ahead replay
 */
   done = terminate read-ahead data collection, keep collected information
   noreplay = terminate read-ahead replay
 */
-int sd_readahead(const char *action) _sd_hidden_;
+int sd_readahead(const char *action);
 
 #ifdef __cplusplus
 }
 
 #ifdef __cplusplus
 }