mirror of
https://github.com/glfw/glfw.git
synced 2024-11-25 22:14:34 +00:00
Fixed warnings on VC++.
This commit is contained in:
parent
c3da8e417f
commit
f0f4af4287
@ -11,6 +11,10 @@ endif()
|
|||||||
include_directories(${GLFW_SOURCE_DIR}/include
|
include_directories(${GLFW_SOURCE_DIR}/include
|
||||||
${GLFW_SOURCE_DIR}/support)
|
${GLFW_SOURCE_DIR}/support)
|
||||||
|
|
||||||
|
if (MSVC)
|
||||||
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (NOT APPLE)
|
if (NOT APPLE)
|
||||||
# HACK: This is NOTFOUND on OS X 10.8
|
# HACK: This is NOTFOUND on OS X 10.8
|
||||||
include_directories(${OPENGL_INCLUDE_DIR})
|
include_directories(${OPENGL_INCLUDE_DIR})
|
||||||
|
@ -23,8 +23,6 @@
|
|||||||
//
|
//
|
||||||
//========================================================================
|
//========================================================================
|
||||||
|
|
||||||
#define _CRT_SECURE_NO_WARNINGS
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
@ -228,7 +228,7 @@ void _glfwDestroyMonitors(void)
|
|||||||
const GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor,
|
const GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor,
|
||||||
const GLFWvidmode* desired)
|
const GLFWvidmode* desired)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
int i;
|
||||||
unsigned int sizeDiff, leastSizeDiff = UINT_MAX;
|
unsigned int sizeDiff, leastSizeDiff = UINT_MAX;
|
||||||
unsigned int colorDiff, leastColorDiff = UINT_MAX;
|
unsigned int colorDiff, leastColorDiff = UINT_MAX;
|
||||||
const GLFWvidmode* current;
|
const GLFWvidmode* current;
|
||||||
|
@ -34,13 +34,19 @@
|
|||||||
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||||
* DAMAGE.
|
* DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
#ifndef _CRT_SECURE_NO_WARNINGS
|
||||||
#define _CRT_SECURE_NO_WARNINGS
|
#define _CRT_SECURE_NO_WARNINGS
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "getopt.h"
|
#include "getopt.h"
|
||||||
|
|
||||||
|
/* 2013-01-06 Camilla Berglund <elmindreda@elmindreda.org>
|
||||||
|
*
|
||||||
|
* Only define _CRT_SECURE_NO_WARNINGS if not already defined.
|
||||||
|
*/
|
||||||
/* 2012-08-12 Lambert Clara <lambert.clara@yahoo.fr>
|
/* 2012-08-12 Lambert Clara <lambert.clara@yahoo.fr>
|
||||||
*
|
*
|
||||||
* Constify third argument of getopt.
|
* Constify third argument of getopt.
|
||||||
|
@ -21,6 +21,11 @@ freely, subject to the following restrictions:
|
|||||||
distribution.
|
distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* 2013-01-06 Camilla Berglund <elmindreda@elmindreda.org>
|
||||||
|
*
|
||||||
|
* Added casts from time_t to DWORD to avoid warnings on VC++.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "tinycthread.h"
|
#include "tinycthread.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
@ -291,8 +296,8 @@ int cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *ts)
|
|||||||
struct timespec now;
|
struct timespec now;
|
||||||
if (clock_gettime(TIME_UTC, &now) == 0)
|
if (clock_gettime(TIME_UTC, &now) == 0)
|
||||||
{
|
{
|
||||||
DWORD delta = (ts->tv_sec - now.tv_sec) * 1000 +
|
DWORD delta = (DWORD) ((ts->tv_sec - now.tv_sec) * 1000 +
|
||||||
(ts->tv_nsec - now.tv_nsec + 500000) / 1000000;
|
(ts->tv_nsec - now.tv_nsec + 500000) / 1000000);
|
||||||
return _cnd_timedwait_win32(cond, mtx, delta);
|
return _cnd_timedwait_win32(cond, mtx, delta);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -471,8 +476,8 @@ int thrd_sleep(const struct timespec *time_point, struct timespec *remaining)
|
|||||||
|
|
||||||
#if defined(_TTHREAD_WIN32_)
|
#if defined(_TTHREAD_WIN32_)
|
||||||
/* Delta in milliseconds */
|
/* Delta in milliseconds */
|
||||||
delta = (time_point->tv_sec - now.tv_sec) * 1000 +
|
delta = (DWORD) ((time_point->tv_sec - now.tv_sec) * 1000 +
|
||||||
(time_point->tv_nsec - now.tv_nsec + 500000) / 1000000;
|
(time_point->tv_nsec - now.tv_nsec + 500000) / 1000000);
|
||||||
if (delta > 0)
|
if (delta > 0)
|
||||||
{
|
{
|
||||||
Sleep(delta);
|
Sleep(delta);
|
||||||
|
@ -16,6 +16,10 @@ endif()
|
|||||||
include_directories(${GLFW_SOURCE_DIR}/include
|
include_directories(${GLFW_SOURCE_DIR}/include
|
||||||
${GLFW_SOURCE_DIR}/support)
|
${GLFW_SOURCE_DIR}/support)
|
||||||
|
|
||||||
|
if (MSVC)
|
||||||
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (NOT APPLE)
|
if (NOT APPLE)
|
||||||
# HACK: This is NOTFOUND on OS X 10.8
|
# HACK: This is NOTFOUND on OS X 10.8
|
||||||
include_directories(${OPENGL_INCLUDE_DIR})
|
include_directories(${OPENGL_INCLUDE_DIR})
|
||||||
|
@ -31,8 +31,6 @@
|
|||||||
//
|
//
|
||||||
//========================================================================
|
//========================================================================
|
||||||
|
|
||||||
#define _CRT_SECURE_NO_WARNINGS
|
|
||||||
|
|
||||||
#include <GL/glfw3.h>
|
#include <GL/glfw3.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -34,6 +34,10 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define strdup(x) _strdup(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct Joystick
|
typedef struct Joystick
|
||||||
{
|
{
|
||||||
GLboolean present;
|
GLboolean present;
|
||||||
|
Loading…
Reference in New Issue
Block a user