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

Compiling using clang-cl #370

Closed
gvanem opened this issue Oct 21, 2017 · 0 comments
Closed

Compiling using clang-cl #370

gvanem opened this issue Oct 21, 2017 · 0 comments

Comments

@gvanem
Copy link

gvanem commented Oct 21, 2017

When building using clang-cl (the awesome MSVC cl replacement), I get this error:

In file included from json_object.c:26:
./linkhash.h(262,1) :  error: expected function body after function declarator
THIS_FUNCTION_IS_DEPRECATED(extern const void* lh_table_lookup(struct lh_table *t, const void *k));
^
./json_object.h(19,48) :  note: expanded from macro 'THIS_FUNCTION_IS_DEPRECATED'
#define THIS_FUNCTION_IS_DEPRECATED(func) func __deprecated
                                               ^

If I make json_object.h check for __clang__ after _MSC_VER, all seems okay:

--- a/json_object.h 2017-10-21 15:22:06
+++ b/json_object.h 2017-10-21 18:19:18
@@ -15,15 +15,15 @@

 #ifdef __GNUC__
 #define THIS_FUNCTION_IS_DEPRECATED(func) func __attribute__ ((deprecated))
-#elif defined(__clang__)
-#define THIS_FUNCTION_IS_DEPRECATED(func) func __deprecated
 #elif defined(_MSC_VER)
 #define THIS_FUNCTION_IS_DEPRECATED(func) __declspec(deprecated) func
+#elif defined(__clang__)
+#define THIS_FUNCTION_IS_DEPRECATED(func) func __deprecated
 #else
 #define THIS_FUNCTION_IS_DEPRECATED(func) func
 #endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants