Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft: temp - updating to compile on MAC #317

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@ CHECK_CXX_COMPILER_FLAG(-Wno-error=nonnull-compare COMPILER_SUPPORTS_NONNULL)
CHECK_CXX_COMPILER_FLAG(-std=c++14 COMPILER_SUPPORTS_CXX14)
CHECK_CXX_COMPILER_FLAG(-std=c++11 COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG(-std=c++0x COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
elseif(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0x)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if(COMPILER_SUPPORTS_CXX14)
if(COMPILER_SUPPORTS_MISIDENT)
Expand All @@ -50,6 +46,22 @@ endif()
# find protobuf package
# ------------------------------------------------------------------------------
find_package(Protobuf REQUIRED)
# find_package(Protobuf CONFIG REQUIRED)
# find_package(Protobuf CONFIG)
# if(NOT Protobuf_FOUND)
# find_package(Protobuf REQUIRED)
# endif()
set(PROTO_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
set(PROTO_IMPORT_DIRS "${CMAKE_CURRENT_LIST_DIR}/proto")
set(waflz_proto_files ${CMAKE_CURRENT_SOURCE_DIR}/proto/acl.proto)
# set(waflz_proto_files ${CMAKE_CURRENT_SOURCE_DIR}/proto/acl.proto action.proto rule.proto profile.proto event.proto request_info.proto scope.proto limit.proto)
add_library(proto-objects OBJECT "${CMAKE_CURRENT_SOURCE_DIR}/proto/acl.proto")
protobuf_generate(
LANGUAGE cpp
TARGET proto-objects
IMPORT_DIRS ${PROTO_IMPORT_DIRS}
PROTOC_OUT_DIR "${PROTO_BINARY_DIR}"
)
# ------------------------------------------------------------------------------
# Display the current settings
# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -154,7 +166,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# --------------------------------------------------------
# cc flags
# --------------------------------------------------------
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# ------------------------------------------------------------------------------
# ASAN
Expand Down
1 change: 1 addition & 0 deletions include/waflz/def.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#if defined(__APPLE__) || defined(__darwin__)
#include <strings.h>
#define RAPIDJSON_NOMEMBERITERATORCLASS 1
#else
#include <string.h>
#endif
Expand Down
41 changes: 25 additions & 16 deletions src/jspb/jspb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -508,14 +508,18 @@ static int32_t update_single_field(google::protobuf::Message& ao_msg,
case google::protobuf::FieldDescriptor::TYPE_DOUBLE:
{
JSPB_TRACE("case: double\n");
l_s = update_field(ao_msg,
a_ref,
a_field,
&google::protobuf::Reflection::SetDouble,
a_val,
&rapidjson::GenericValue<rapidjson::UTF8<> >::GetDouble,
&rapidjson::GenericValue<rapidjson::UTF8<> >::IsNumber,
"float");
l_s = update_field<
void (google::protobuf::Reflection::*)(google::protobuf::Message*, const google::protobuf::FieldDescriptor*, double) const,
double (rapidjson::GenericValue<rapidjson::UTF8<> >::*)() const,
bool (rapidjson::GenericValue<rapidjson::UTF8<> >::*)() const>(
ao_msg,
a_ref,
a_field,
&google::protobuf::Reflection::SetDouble,
a_val,
&rapidjson::GenericValue<rapidjson::UTF8<> >::GetDouble,
&rapidjson::GenericValue<rapidjson::UTF8<> >::IsNumber,
"float");
break;
}
case google::protobuf::FieldDescriptor::TYPE_FLOAT:
Expand Down Expand Up @@ -605,14 +609,19 @@ static int32_t update_single_field(google::protobuf::Message& ao_msg,
case google::protobuf::FieldDescriptor::TYPE_STRING:
{
JSPB_TRACE("case: string\n");
l_s = update_field(ao_msg,
a_ref,
a_field,
&google::protobuf::Reflection::SetString,
a_val,
&rapidjson::GenericValue<rapidjson::UTF8<> >::GetString,
&rapidjson::GenericValue<rapidjson::UTF8<> >::IsString,
"string");
l_s = update_field<
void (google::protobuf::Reflection::*)(google::protobuf::Message*, const google::protobuf::FieldDescriptor*, const std::string) const,
const rapidjson::GenericValue<rapidjson::UTF8<>>::Ch* (rapidjson::GenericValue<rapidjson::UTF8<> >::*)() const,
bool (rapidjson::GenericValue<rapidjson::UTF8<> >::*)() const
>(
ao_msg,
a_ref,
a_field,
&google::protobuf::Reflection::SetString,
a_val,
&rapidjson::GenericValue<rapidjson::UTF8<> >::GetString,
&rapidjson::GenericValue<rapidjson::UTF8<> >::IsString,
"string");
break;
}
case google::protobuf::FieldDescriptor::TYPE_GROUP:
Expand Down
3 changes: 3 additions & 0 deletions src/jspb/jspb.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
//! ----------------------------------------------------------------------------
//! includes
//! ----------------------------------------------------------------------------
#if defined(__APPLE__) || defined(__darwin__)
#define RAPIDJSON_NOMEMBERITERATORCLASS 1
#endif
#include <google/protobuf/message.h>
#include <rapidjson/document.h>
//! ----------------------------------------------------------------------------
Expand Down
Loading