fate-extra / xxhash

Automatically exported from code.google.com/p/xxhash
Other
0 stars 0 forks source link

xxhash.c won't compile with gcc on Mac OS X #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. gcc xxhash.c
2.
3.

What is the expected output? What do you see instead?
Edited output:
Undefined symbols:
  "__rotl", referenced from:
      _XXH_small in xxhash.o
      _XXH_fast32 in xxhash.o
      _XXH_strong32 in xxhash.o

What version of the product are you using? On what operating system?
Mac OS X 10.6.ish
gcc on the command line

Please provide any additional information below.
Adding something like the follow to xxhash.c seems to resolve this though I 
admit my C skills are weak:

#if !defined(_MSC_VER)
    #define _rotl(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
#endif

Original issue reported on code.google.com by sandy...@gmail.com on 9 May 2012 at 4:09

GoogleCodeExporter commented 8 years ago
Thanks. This is very well described issue. Definitely high in the list of "to 
do" improvements.

Original comment by yann.col...@gmail.com on 9 May 2012 at 8:51

GoogleCodeExporter commented 8 years ago
While release r2 is primarily about providing a benchmark function for easier 
evaluation, xxHash.c has also been slightly modified to introduce 
software-defined _rotl() outside of Windows, as suggested.

Would you please tell me if this works for you ?

Regards

Original comment by yann.col...@gmail.com on 10 May 2012 at 1:25

GoogleCodeExporter commented 8 years ago
works for me on both my mac and linux box.

Original comment by sandy...@gmail.com on 10 May 2012 at 3:37

GoogleCodeExporter commented 8 years ago
Thanks for the report. Issue solved with r2.

Original comment by yann.col...@gmail.com on 10 May 2012 at 11:39