Cleaning up build on gcc
This commit is contained in:
@@ -11,13 +11,9 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifndef __APPLE__
|
|
||||||
#include <malloc.h>
|
|
||||||
#else
|
|
||||||
#include <stdlib.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//*** For the Windows SDK _tempnam function ***//
|
//*** For the Windows SDK _tempnam function ***//
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@@ -174,7 +170,7 @@ int openoutfile(Project *pr)
|
|||||||
|
|
||||||
// Close output file if already opened
|
// Close output file if already opened
|
||||||
closeoutfile(pr);
|
closeoutfile(pr);
|
||||||
|
|
||||||
// If output file name was supplied, then attempt to
|
// If output file name was supplied, then attempt to
|
||||||
// open it. Otherwise open a temporary output file.
|
// open it. Otherwise open a temporary output file.
|
||||||
pr->outfile.OutFile = fopen(pr->outfile.OutFname, "w+b");
|
pr->outfile.OutFile = fopen(pr->outfile.OutFname, "w+b");
|
||||||
@@ -284,7 +280,7 @@ void initpointers(Project *pr)
|
|||||||
pr->hydraul.smatrix.XLNZ = NULL;
|
pr->hydraul.smatrix.XLNZ = NULL;
|
||||||
pr->hydraul.smatrix.NZSUB = NULL;
|
pr->hydraul.smatrix.NZSUB = NULL;
|
||||||
pr->hydraul.smatrix.LNZ = NULL;
|
pr->hydraul.smatrix.LNZ = NULL;
|
||||||
|
|
||||||
initrules(pr);
|
initrules(pr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1027,7 +1023,7 @@ char *xstrcpy(char **s1, const char *s2, const size_t n)
|
|||||||
{
|
{
|
||||||
size_t n1 = 0, n2;
|
size_t n1 = 0, n2;
|
||||||
|
|
||||||
// Source string is empty -- free destination string
|
// Source string is empty -- free destination string
|
||||||
if (s2 == NULL || strlen(s2) == 0)
|
if (s2 == NULL || strlen(s2) == 0)
|
||||||
{
|
{
|
||||||
free(*s1);
|
free(*s1);
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ int open_file(file_handle_t *file_handle, const char *filename, const char *file
|
|||||||
|
|
||||||
int seek_file(file_handle_t *file_handle, F_OFF offset, int whence)
|
int seek_file(file_handle_t *file_handle, F_OFF offset, int whence)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32 // Windows (32-bit and 64-bit)
|
#ifdef _MSC_VER // Windows (32-bit and 64-bit)
|
||||||
#define FSEEK64 _fseeki64
|
#define FSEEK64 _fseeki64
|
||||||
#else // Other platforms
|
#else // Other platforms
|
||||||
#define FSEEK64 fseeko
|
#define FSEEK64 fseeko
|
||||||
@@ -97,7 +97,7 @@ int seek_file(file_handle_t *file_handle, F_OFF offset, int whence)
|
|||||||
|
|
||||||
F_OFF tell_file(file_handle_t *file_handle)
|
F_OFF tell_file(file_handle_t *file_handle)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32 // Windows (32-bit and 64-bit)
|
#ifdef _MSC_VER // Windows (32-bit and 64-bit)
|
||||||
#define FTELL64 _ftelli64
|
#define FTELL64 _ftelli64
|
||||||
#else // Other platforms
|
#else // Other platforms
|
||||||
#define FTELL64 ftello
|
#define FTELL64 ftello
|
||||||
@@ -185,7 +185,7 @@ int _get_temp_filename(char **tempname)
|
|||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _MSC_VER
|
||||||
char *name = NULL;
|
char *name = NULL;
|
||||||
|
|
||||||
// --- use Windows _tempnam function to get a pointer to an
|
// --- use Windows _tempnam function to get a pointer to an
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
|
|
||||||
// F_OFF Must be a 8 byte / 64 bit integer for large file support
|
// F_OFF Must be a 8 byte / 64 bit integer for large file support
|
||||||
#ifdef _WIN32 // Windows (32-bit and 64-bit)
|
#ifdef _MSC_VER // Windows (32-bit and 64-bit)
|
||||||
#define F_OFF __int64
|
#define F_OFF __int64
|
||||||
#else // Other platforms
|
#else // Other platforms
|
||||||
#define F_OFF off_t
|
#define F_OFF off_t
|
||||||
|
|||||||
Reference in New Issue
Block a user