Skip to content

Commit cd201e2

Browse files
author
Duion
committed
64 bit upgrade
1 parent 9ae5bf1 commit cd201e2

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

CMakeLists.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
cmake_minimum_required(VERSION 2.3)
22

3-
# if(CMAKE_COMPILER_IS_GNUCXX)
4-
# set( CMAKE_CXX_FLAGS "/GLOBAL_FLAGS_GO_HERE")
5-
# set( CMAKE_CXX_FLAGS_DEBUG "-Wall -g -O2")
6-
# set( CMAKE_CXX_FLAGS_RELEASE "-Wall -O2")
7-
# endif()
8-
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -m32")
3+
if(CMAKE_COMPILER_IS_GNUCXX)
4+
set( CMAKE_CXX_FLAGS "/GLOBAL_FLAGS_GO_HERE")
5+
set( CMAKE_CXX_FLAGS_DEBUG "-Wall -g -O2")
6+
set( CMAKE_CXX_FLAGS_RELEASE "-Wall -O2")
7+
endif()
8+
#set(CMAKE_CXX_FLAGS "-Wall -g -m32")
99

1010
PROJECT(pbms)
1111
OPTION(SERVERSTORE_RAM "Build using ServerStoreRAM" ON)

include/commonTypes.h

+14
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* NOTE: These type defines are 32bit/64bit x86 arch biased.
88
*/
99

10+
/*
1011
typedef signed char S8;
1112
typedef signed short S16;
1213
typedef signed int S32;
@@ -16,6 +17,19 @@ typedef unsigned char U8;
1617
typedef unsigned short U16;
1718
typedef unsigned int U32;
1819
typedef unsigned long long U64;
20+
*/
21+
22+
#include <stdint.h>
23+
24+
typedef int8_t S8;
25+
typedef int16_t S16;
26+
typedef int32_t S32;
27+
typedef int64_t S64;
28+
29+
typedef uint8_t U8;
30+
typedef uint16_t U16;
31+
typedef uint32_t U32;
32+
typedef uint64_t U64;
1933

2034
typedef float F32;
2135
typedef double F64;

masterd/core.cc

+4-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ using namespace std;
3434

3535
#if !defined(WIN32) && defined(__GNUC__)
3636
#include <signal.h>
37-
// #include <sys/types.h>
37+
#include <sys/types.h>
38+
#include <unistd.h>
3839
#define stricmp strcasecmp
3940
#define strnicmp strncasecmp
4041
#endif
@@ -191,7 +192,7 @@ char* strnextfield(char *str, size_t *clen)
191192

192193
// update previous field's length to caller
193194
if(clen)
194-
*clen = (U32)p - (U32)str;
195+
*clen = (U64)p - (U64)str;
195196

196197
// find the field after whitespaces
197198
num = strspn(p, whitespaces);
@@ -765,7 +766,7 @@ void MasterdCore::CreatePrefs(void)
765766
}
766767

767768
// figure out string length before newline
768-
len = ((U32)str2 - (U32)str);
769+
len = ((U64)str2 - (U64)str);
769770

770771
// write out string just before newline
771772
fout << CONFIG_LINE_COMMENT;

0 commit comments

Comments
 (0)