Skip to content

Commit e4f17ad

Browse files
committed
2 parents 9f78985 + 60973ef commit e4f17ad

File tree

16 files changed

+3730
-3623
lines changed

16 files changed

+3730
-3623
lines changed

platforms/win32/plugins/CameraPlugin/winCameraOps.cpp

Lines changed: 485 additions & 485 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
#include <windows.h>
2-
#include "CroquetPlugin.h"
3-
4-
static int loaded = 0;
5-
static HMODULE hAdvApi32 = NULL;
6-
static BOOLEAN (__stdcall *RtlGenRandom)(PVOID, ULONG) = NULL;
7-
8-
sqInt ioGatherEntropy(char *bufPtr, sqInt bufSize) {
9-
if(!loaded) {
10-
loaded = 1;
11-
hAdvApi32 = LoadLibraryA("advapi32.dll");
12-
if (!hAdvApi32) return 0;
13-
RtlGenRandom = (void*)GetProcAddress(hAdvApi32, "SystemFunction036");
14-
}
15-
if(!RtlGenRandom) return 0;
16-
return RtlGenRandom(bufPtr, bufSize);
17-
}
1+
#include <windows.h>
2+
#include "CroquetPlugin.h"
3+
4+
static int loaded = 0;
5+
static HMODULE hAdvApi32 = NULL;
6+
static BOOLEAN (__stdcall *RtlGenRandom)(PVOID, ULONG) = NULL;
7+
8+
sqInt ioGatherEntropy(char *bufPtr, sqInt bufSize) {
9+
if(!loaded) {
10+
loaded = 1;
11+
hAdvApi32 = LoadLibraryA("advapi32.dll");
12+
if (!hAdvApi32) return 0;
13+
RtlGenRandom = (void*)GetProcAddress(hAdvApi32, "SystemFunction036");
14+
}
15+
if(!RtlGenRandom) return 0;
16+
return RtlGenRandom(bufPtr, bufSize);
17+
}
Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
/***************************************************************************/
2-
/* */
3-
/* ft2build.h */
4-
/* */
5-
/* FreeType 2 build and setup macros. */
6-
/* (Generic version) */
7-
/* */
8-
/* Copyright 1996-2001, 2006 by */
9-
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
10-
/* */
11-
/* This file is part of the FreeType project, and may only be used, */
12-
/* modified, and distributed under the terms of the FreeType project */
13-
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14-
/* this file you indicate that you have read the license and */
15-
/* understand and accept it fully. */
16-
/* */
17-
/***************************************************************************/
18-
19-
20-
/*************************************************************************/
21-
/* */
22-
/* This file corresponds to the default `ft2build.h' file for */
23-
/* FreeType 2. It uses the `freetype' include root. */
24-
/* */
25-
/* Note that specific platforms might use a different configuration. */
26-
/* See builds/unix/ft2unix.h for an example. */
27-
/* */
28-
/*************************************************************************/
29-
30-
31-
#ifndef __FT2_BUILD_GENERIC_H__
32-
#define __FT2_BUILD_GENERIC_H__
33-
34-
#include <freetype/config/ftheader.h>
35-
36-
#endif /* __FT2_BUILD_GENERIC_H__ */
37-
38-
39-
/* END */
1+
/***************************************************************************/
2+
/* */
3+
/* ft2build.h */
4+
/* */
5+
/* FreeType 2 build and setup macros. */
6+
/* (Generic version) */
7+
/* */
8+
/* Copyright 1996-2001, 2006 by */
9+
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
10+
/* */
11+
/* This file is part of the FreeType project, and may only be used, */
12+
/* modified, and distributed under the terms of the FreeType project */
13+
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14+
/* this file you indicate that you have read the license and */
15+
/* understand and accept it fully. */
16+
/* */
17+
/***************************************************************************/
18+
19+
20+
/*************************************************************************/
21+
/* */
22+
/* This file corresponds to the default `ft2build.h' file for */
23+
/* FreeType 2. It uses the `freetype' include root. */
24+
/* */
25+
/* Note that specific platforms might use a different configuration. */
26+
/* See builds/unix/ft2unix.h for an example. */
27+
/* */
28+
/*************************************************************************/
29+
30+
31+
#ifndef __FT2_BUILD_GENERIC_H__
32+
#define __FT2_BUILD_GENERIC_H__
33+
34+
#include <freetype/config/ftheader.h>
35+
36+
#endif /* __FT2_BUILD_GENERIC_H__ */
37+
38+
39+
/* END */
Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
1-
#ifndef __SQ_WIN32_FILE_H
2-
#define __SQ_WIN32_FILE_H
3-
4-
/**
5-
Converts multi-byte characters to wide characters. Handles paths longer
6-
than 260 characters (including NULL) by prepending "\\?\" to encode UNC
7-
paths as suggested in http://msdn.microsoft.com/en-us/library/windows/
8-
desktop/aa365247%28v=vs.85%29.aspx#maxpath
9-
"The maximum path of 32,767 characters is approximate,
10-
because the "\\?\" prefix may be expanded to a longer
11-
string by the system at run time, and this expansion
12-
applies to the total length."
13-
14-
Note that we do not check for the correct path component size,
15-
which should be MAX_PATH in general but can vary between file systems.
16-
Actually, we should perform an additional check with
17-
GetVolumneInformation to acquire lpMaximumComponentLength.
18-
19-
Note that another possibility would be to use 8.3 aliases
20-
for path components like the Windows Explorer does. However,
21-
this feature also depends on the volume specifications.
22-
23-
Calling alloca() should be fine because we limit path length to 32k.
24-
Stack size limit is much higher.
25-
26-
When using an API to create a directory, the specified path cannot be
27-
so long that you cannot append an 8.3 file name (that is, the directory
28-
name cannot exceed MAX_PATH minus 12).
29-
**/
30-
31-
#include <malloc.h>
32-
33-
#define ALLOC_WIN32_PATH(out_path, in_name, in_size) { \
34-
int sz = MultiByteToWideChar(CP_UTF8, 0, in_name, in_size, NULL, 0); \
35-
if(sz >= 32767) FAIL(); \
36-
if(sz >= MAX_PATH-12 /* for directory creation; see above */) { \
37-
out_path = (WCHAR*)alloca((sz + 4 + 1) * sizeof(WCHAR)); \
38-
out_path[0] = L'\\'; out_path[1] = L'\\'; \
39-
out_path[2] = L'?'; out_path[3] = L'\\'; \
40-
MultiByteToWideChar(CP_UTF8, 0, in_name, in_size, out_path + 4, sz); \
41-
out_path[sz + 4] = 0; \
42-
} else { \
43-
out_path = (WCHAR*)alloca((sz + 1) * sizeof(WCHAR)); \
44-
MultiByteToWideChar(CP_UTF8, 0, in_name, in_size, out_path, sz); \
45-
out_path[sz] = 0; \
46-
} \
47-
}
48-
49-
#endif /* __SQ_WIN32_FILE_H */
1+
#ifndef __SQ_WIN32_FILE_H
2+
#define __SQ_WIN32_FILE_H
3+
4+
/**
5+
Converts multi-byte characters to wide characters. Handles paths longer
6+
than 260 characters (including NULL) by prepending "\\?\" to encode UNC
7+
paths as suggested in http://msdn.microsoft.com/en-us/library/windows/
8+
desktop/aa365247%28v=vs.85%29.aspx#maxpath
9+
"The maximum path of 32,767 characters is approximate,
10+
because the "\\?\" prefix may be expanded to a longer
11+
string by the system at run time, and this expansion
12+
applies to the total length."
13+
14+
Note that we do not check for the correct path component size,
15+
which should be MAX_PATH in general but can vary between file systems.
16+
Actually, we should perform an additional check with
17+
GetVolumneInformation to acquire lpMaximumComponentLength.
18+
19+
Note that another possibility would be to use 8.3 aliases
20+
for path components like the Windows Explorer does. However,
21+
this feature also depends on the volume specifications.
22+
23+
Calling alloca() should be fine because we limit path length to 32k.
24+
Stack size limit is much higher.
25+
26+
When using an API to create a directory, the specified path cannot be
27+
so long that you cannot append an 8.3 file name (that is, the directory
28+
name cannot exceed MAX_PATH minus 12).
29+
**/
30+
31+
#include <malloc.h>
32+
33+
#define ALLOC_WIN32_PATH(out_path, in_name, in_size) { \
34+
int sz = MultiByteToWideChar(CP_UTF8, 0, in_name, in_size, NULL, 0); \
35+
if(sz >= 32767) FAIL(); \
36+
if(sz >= MAX_PATH-12 /* for directory creation; see above */) { \
37+
out_path = (WCHAR*)alloca((sz + 4 + 1) * sizeof(WCHAR)); \
38+
out_path[0] = L'\\'; out_path[1] = L'\\'; \
39+
out_path[2] = L'?'; out_path[3] = L'\\'; \
40+
MultiByteToWideChar(CP_UTF8, 0, in_name, in_size, out_path + 4, sz); \
41+
out_path[sz + 4] = 0; \
42+
} else { \
43+
out_path = (WCHAR*)alloca((sz + 1) * sizeof(WCHAR)); \
44+
MultiByteToWideChar(CP_UTF8, 0, in_name, in_size, out_path, sz); \
45+
out_path[sz] = 0; \
46+
} \
47+
}
48+
49+
#endif /* __SQ_WIN32_FILE_H */
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
include ../../Makefile.plugin
2-
3-
# Special OFLAGS for some files
4-
k_tan.o: k_tan.c
5-
$(MAKE) -f ../../Makefile.plugin OFLAGS="-O0" $*.o
6-
7-
acos.o: acos.c
8-
$(MAKE) -f ../../Makefile.plugin OFLAGS="-O0" $*.o
9-
10-
tanh.o: tanh.c
11-
$(MAKE) -f ../../Makefile.plugin OFLAGS="-O0" $*.o
1+
include ../../Makefile.plugin
2+
3+
# Special OFLAGS for some files
4+
k_tan.o: k_tan.c
5+
$(MAKE) -f ../../Makefile.plugin OFLAGS="-O0" $*.o
6+
7+
acos.o: acos.c
8+
$(MAKE) -f ../../Makefile.plugin OFLAGS="-O0" $*.o
9+
10+
tanh.o: tanh.c
11+
$(MAKE) -f ../../Makefile.plugin OFLAGS="-O0" $*.o
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
include ../common/Makefile.plugin
2-
3-
# Special OFLAGS for some files
4-
k_tan.o: k_tan.c
5-
$(MAKE) -f ../common/Makefile.plugin OFLAGS="-O0" $*.o
6-
7-
acos.o: acos.c
8-
$(MAKE) -f ../common/Makefile.plugin OFLAGS="-O0" $*.o
9-
10-
tanh.o: tanh.c
11-
$(MAKE) -f ../common/Makefile.plugin OFLAGS="-O0" $*.o
1+
include ../common/Makefile.plugin
2+
3+
# Special OFLAGS for some files
4+
k_tan.o: k_tan.c
5+
$(MAKE) -f ../common/Makefile.plugin OFLAGS="-O0" $*.o
6+
7+
acos.o: acos.c
8+
$(MAKE) -f ../common/Makefile.plugin OFLAGS="-O0" $*.o
9+
10+
tanh.o: tanh.c
11+
$(MAKE) -f ../common/Makefile.plugin OFLAGS="-O0" $*.o
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
include ../../Makefile.mingw32
2-
3-
# Special OFLAGS for some files
4-
k_tan.o: k_tan.c
5-
$(MAKE) -f ../../Makefile.mingw32 OFLAGS="-O0" $*.o
6-
7-
acos.o: acos.c
8-
$(MAKE) -f ../../Makefile.mingw32 OFLAGS="-O0" $*.o
9-
10-
tanh.o: tanh.c
11-
$(MAKE) -f ../../Makefile.mingw32 OFLAGS="-O0" $*.o
1+
include ../../Makefile.mingw32
2+
3+
# Special OFLAGS for some files
4+
k_tan.o: k_tan.c
5+
$(MAKE) -f ../../Makefile.mingw32 OFLAGS="-O0" $*.o
6+
7+
acos.o: acos.c
8+
$(MAKE) -f ../../Makefile.mingw32 OFLAGS="-O0" $*.o
9+
10+
tanh.o: tanh.c
11+
$(MAKE) -f ../../Makefile.mingw32 OFLAGS="-O0" $*.o

0 commit comments

Comments
 (0)