提交 f6447e8a 编写于 作者: E Eric Blake

build: avoid compiler warning on cygwin

In file included from util/threads.c:31:
util/threads-pthread.c: In function 'virThreadSelfID':
util/threads-pthread.c:214: warning: cast from function call of type 'pthread_t' to non-matching type 'int' [-Wbad-function-cast]

* src/util/threads-pthread.c (virThreadSelfID) [!SYS_gettid]:
Add intermediate cast to silence gcc.
上级 bf7f6251
/* /*
* threads-pthread.c: basic thread synchronization primitives * threads-pthread.c: basic thread synchronization primitives
* *
* Copyright (C) 2009-2010 Red Hat, Inc. * Copyright (C) 2009-2011 Red Hat, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
...@@ -211,7 +211,7 @@ int virThreadSelfID(void) ...@@ -211,7 +211,7 @@ int virThreadSelfID(void)
tid = syscall(SYS_gettid); tid = syscall(SYS_gettid);
return (int)tid; return (int)tid;
#else #else
return (int)pthread_self(); return (int)(void *)pthread_self();
#endif #endif
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册