Hi,
   I got the following error when building trousers with clang

  I got the error

ps/ps_utils.c:164: error: undefined reference to 'write_data'
ps/ps_utils.c:176: error: undefined reference to 'write_data'
ps/ps_utils.c:204: error: undefined reference to 'write_data'
ps/ps_utils.c:404: error: undefined reference to 'read_data'
ps/ps_utils.c:410: error: undefined reference to 'read_data'
ps/ps_utils.c:416: error: undefined reference to 'read_data'
ps/ps_utils.c:425: error: undefined reference to 'read_data'
ps/tcsps.c:595: error: undefined reference to 'write_data'

This is because the functions write_data and read_data are declared
with inline, but their definition is not in .h files.


   Below is the proposed patch.
   Thanks

   trousers: remove inline keyword from two functions.

    Inline functions only make sense when you put them in a ".h" file.
    The whole concept is about making the function definition visible
    to all callers.

    This patch removes the inline keyword from function read_data and
    write_data because they are in .c file and they are used by other
    c files.

diff --git a/src/include/tcsps.h b/src/include/tcsps.h
index 8754296..ef3358a 100644
--- a/src/include/tcsps.h
+++ b/src/include/tcsps.h
@@ -23,13 +23,6 @@ int             get_file();
 int               put_file(int);
 void              close_file(int);
 void              ps_destroy();
-#ifdef SOLARIS
-TSS_RESULT  read_data(int, void *, UINT32);
-TSS_RESULT  write_data(int, void *, UINT32);
-#else
-inline TSS_RESULT  read_data(int, void *, UINT32);
-inline TSS_RESULT  write_data(int, void *, UINT32);
-#endif
 int               write_key_init(int, UINT32, UINT32, UINT32);
 TSS_RESULT        cache_key(UINT32, UINT16, TSS_UUID *, TSS_UUID *,
UINT16, UINT32, UINT32);
 TSS_RESULT        UnloadBlob_KEY_PS(UINT16 *, BYTE *, TSS_KEY *);
diff --git a/src/include/tspps.h b/src/include/tspps.h
index 17b0aab..00bcfae 100644
--- a/src/include/tspps.h
+++ b/src/include/tspps.h
@@ -18,8 +18,8 @@

 TSS_RESULT        get_file(int *);
 int               put_file(int);
-inline TSS_RESULT  read_data(int, void *, UINT32);
-inline TSS_RESULT  write_data(int, void *, UINT32);
+TSS_RESULT        read_data(int, void *, UINT32);
+TSS_RESULT        write_data(int, void *, UINT32);
 UINT32            psfile_get_num_keys(int);
 TSS_RESULT        psfile_get_parent_uuid_by_uuid(int, TSS_UUID *, TSS_UUID
*);
 TSS_RESULT        psfile_remove_key_by_uuid(int, TSS_UUID *);
diff --git a/src/tcs/ps/ps_utils.c b/src/tcs/ps/ps_utils.c
index 82838ab..1cbc1ce 100644
--- a/src/tcs/ps/ps_utils.c
+++ b/src/tcs/ps/ps_utils.c
@@ -42,11 +42,7 @@
 struct key_disk_cache *key_disk_cache_head = NULL;


-#ifdef SOLARIS
 TSS_RESULT
-#else
-inline TSS_RESULT
-#endif
 read_data(int fd, void *data, UINT32 size)
 {
        int rc;
@@ -64,11 +60,7 @@ read_data(int fd, void *data, UINT32 size)
 }


-#ifdef SOLARIS
 TSS_RESULT
-#else
-inline TSS_RESULT
-#endif
 write_data(int fd, void *data, UINT32 size)
 {
        int rc;
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
TrouSerS-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/trousers-tech

Reply via email to