Skip to content

Commit

Permalink
Add JL_CONST_FUNC and define NORETURN for MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed Nov 21, 2015
1 parent 76e040b commit add76fe
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,16 @@ extern "C" {
#define NWORDS(sz) (((sz)+3)>>2)
#endif

#if __GNUC__
#define NORETURN __attribute__ ((noreturn))
#if defined(__GNUC__)
# define NORETURN __attribute__ ((noreturn))
# define JL_CONST_FUNC __attribute__((const))
#elseif defined(_COMPILER_MICROSOFT_)
# define NORETURN __declspec(noreturn)
// This is the closest I can find for __attribute__((const))
# define JL_CONST_FUNC __declspec(noalias)
#else
#define NORETURN
# define NORETURN
# define JL_CONST_FUNC
#endif

#define container_of(ptr, type, member) \
Expand Down

0 comments on commit add76fe

Please sign in to comment.