Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make inline Functions static #28

Open
GoogleCodeExporter opened this issue Mar 16, 2015 · 0 comments
Open

Make inline Functions static #28

GoogleCodeExporter opened this issue Mar 16, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Rename Murmurhash3.cpp to Murmurhash3.c
2. Import Murmurhash3.h and Murmurhash3.c into Xcode
3. Attempt to compile it into a project.

What is the expected output? What do you see instead?

Should work, but to errors:

Undefined symbols for architecture i386:
  "_rotl32", referenced from:
      _MurmurHash3_x86_32 in MurmurHash3.o
      _MurmurHash3_x86_128 in MurmurHash3.o
  "_rotl64", referenced from:
      _MurmurHash3_x64_128 in MurmurHash3.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

What version of the product are you using? On what operating system?

Copied from Subversion today (2014-05-05). Xcode 5.1.1.

Please provide any additional information below.

Was able to get it to work by making those functions static:

Index: MurmurHash3.cpp
===================================================================
--- MurmurHash3.cpp (revision 152)
+++ MurmurHash3.cpp (working copy)
@@ -31,12 +31,12 @@

 #define    FORCE_INLINE inline __attribute__((always_inline))

-inline uint32_t rotl32 ( uint32_t x, int8_t r )
+static inline uint32_t rotl32 ( uint32_t x, int8_t r )
 {
   return (x << r) | (x >> (32 - r));
 }

-inline uint64_t rotl64 ( uint64_t x, int8_t r )
+static inline uint64_t rotl64 ( uint64_t x, int8_t r )
 {
   return (x << r) | (x >> (64 - r));
 }

Original issue reported on code.google.com by justathe...@gmail.com on 5 May 2014 at 10:22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant