Skip to content

Commit

Permalink
fix build error in other platform
Browse files Browse the repository at this point in the history
  • Loading branch information
joonhaengHeo committed Oct 16, 2023
1 parent cc02025 commit 81b8aa1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/inet/InetInterfaceImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@

#pragma once

// Define if_nameindex to be implemented in the platform layer
#include <net/if.h>
#include <system/SystemConfig.h>

#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS
#include <net/if.h>

namespace chip {
namespace Inet {
// Define if_nameindex to be implemented in the platform layer
struct if_nameindex * if_nameindexImpl(void);
void if_freenameindexImpl(struct if_nameindex *);
} // namespace Inet
Expand Down
3 changes: 1 addition & 2 deletions src/inet/InetInterfaceImplDefault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <inet/InetInterfaceImpl.h>
#include <net/if.h>

#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS
#include <net/if.h>
namespace chip {
namespace Inet {
struct if_nameindex * if_nameindexImpl(void)
Expand Down
21 changes: 19 additions & 2 deletions src/platform/android/InetInterfaceImpl.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
/*
*
* Copyright (c) 2020-2023 Project CHIP Authors
*
* Licensed 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.
*/

#include <ifaddrs.h>
#include <inet/InetInterfaceImpl.h>

#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS
#include <ifaddrs.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CodeUtils.h>
#include <net/if.h>
#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS
namespace chip {
namespace Inet {

Expand Down

0 comments on commit 81b8aa1

Please sign in to comment.