ademakov commented on code in PR #1272:
URL: https://github.com/apache/ignite-3/pull/1272#discussion_r1008124377


##########
modules/platforms/cpp/ignite/network/network.cpp:
##########
@@ -23,15 +23,20 @@
 
 #ifdef _WIN32
 # include "detail/win/win_async_client_pool.h"
-#else // Other. Assume Linux
+#elif __linux__

Review Comment:
   This is non-standard preprocessor usage.  `#elif` should go after `#if` not 
`#ifdef`. So you have to replace to `#ifdef XXX` with `#if defined(XXX)`/



##########
modules/platforms/cpp/ignite/common/config.h:
##########
@@ -51,10 +51,12 @@
 #endif
 
 /**
- * Macro IGNITE_SWITCH_WIN_OTHER that uses first option on Windows and second 
on any other OS.
+ * Macro IGNITE_OS_SWITCH that uses first option on Windows, second on Linux 
and third on MacOS.

Review Comment:
   As we add support for more OSes this might get rather unwieldy. I think we 
should get rid of this and find something more friendly for future extensions.



##########
modules/platforms/cpp/tests/test-common/detail/macos_process.h:
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+// It's OK that this code is entirely in header as it only supposed to be 
included from a single file.
+
+#include "cmd_process.h"
+#include "unix_process.h"
+
+#include <chrono>
+#include <iostream>
+#include <string>
+#include <vector>
+
+#include <csignal>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+namespace ignite::detail {
+
+/**
+ * Implementation of CmdProcess for Windows.
+ */
+class MacosProcess : public ignite::detail::UnixProcess {
+public:
+    /**
+     * Constructor.
+     *
+     * @param command Command.
+     * @param args Arguments.
+     * @param workDir Working directory.
+     */
+    MacosProcess(std::string command, std::vector<std::string> args, 
std::string workDir)

Review Comment:
   You can just write something like this:
   ```
       // Inherit parent class constructor.
       using UnixProcess::UnixProcess;
   ```



##########
modules/platforms/cpp/ignite/network/length_prefix_codec.cpp:
##########
@@ -62,7 +62,7 @@ data_buffer_ref length_prefix_codec::decode(data_buffer_ref 
&data) {
         if (m_packet.size() < PACKET_HEADER_SIZE)
             return {};
 
-        m_packet_size = bytes::load<endian::LITTLE, int32_t>(m_packet.data());
+        m_packet_size = bytes::load<endian::BIG, int32_t>(m_packet.data());

Review Comment:
   Don't we prefer the little-endian byte order in AI?



##########
modules/platforms/cpp/tests/test-common/ignite_runner.cpp:
##########
@@ -30,8 +30,8 @@ namespace {
 /**
  * System shell command string.
  */
-constexpr std::string_view SYSTEM_SHELL = IGNITE_SWITCH_WIN_OTHER("cmd.exe", 
"/bin/sh");
-constexpr std::string_view SYSTEM_SHELL_ARG_0 = IGNITE_SWITCH_WIN_OTHER("/c ", 
"-c");
+constexpr std::string_view SYSTEM_SHELL = IGNITE_OS_SWITCH("cmd.exe", 
"/bin/sh", "/bin/bash");

Review Comment:
   Why `bash`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to