Browse Source

Fixed fread issues under Windows.

nfactor-troky
Ycros 14 years ago
parent
commit
52d6e7ca37
  1. 6
      ocl.c

6
ocl.c

@ -31,7 +31,7 @@ extern int opt_worksize;
char *file_contents(const char *filename, int *length) char *file_contents(const char *filename, int *length)
{ {
FILE *f = fopen(filename, "r"); FILE *f = fopen(filename, "rb");
void *buffer; void *buffer;
if (!f) { if (!f) {
@ -384,7 +384,7 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
strcat(binaryfilename, numbuf); strcat(binaryfilename, numbuf);
strcat(binaryfilename, ".bin"); strcat(binaryfilename, ".bin");
binaryfile = fopen(binaryfilename, "r"); binaryfile = fopen(binaryfilename, "rb");
if (!binaryfile) { if (!binaryfile) {
if (opt_debug) if (opt_debug)
applog(LOG_DEBUG, "No binary found, generating from source"); applog(LOG_DEBUG, "No binary found, generating from source");
@ -570,7 +570,7 @@ build:
free(rawsource); free(rawsource);
/* Save the binary to be loaded next time */ /* Save the binary to be loaded next time */
binaryfile = fopen(binaryfilename, "w"); binaryfile = fopen(binaryfilename, "wb");
if (!binaryfile) { if (!binaryfile) {
/* Not a fatal problem, just means we build it again next time */ /* Not a fatal problem, just means we build it again next time */
if (opt_debug) if (opt_debug)

Loading…
Cancel
Save