Skip to content

Commit

Permalink
resolve collision with pre-processsor makro
Browse files Browse the repository at this point in the history
  • Loading branch information
dbahrdt committed Jul 15, 2016
1 parent d6dd3ce commit 85718e1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions osmpbf/blobfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void BlobFileIn::readBlobHeader(uint32_t & blobLength, osmpbf::BlobDataType & bl

if (m_VerboseOutput) std::cout << "checking blob header ..." << std::endl;

uint32_t headerLength = osmpbf::ntohl(* (uint32_t *) fileData());
uint32_t headerLength = osmpbf::net2hostLong(* (uint32_t *) fileData());

if (m_VerboseOutput) std::cout << "header length : " << headerLength << " B" << std::endl;

Expand Down Expand Up @@ -527,7 +527,7 @@ bool BlobFileOut::writeBlob(osmpbf::BlobDataType type, const char * buffer, uint

// write header size
uint32_t headerSize = blobHeader->ByteSize();
headerSize = osmpbf::htonl(headerSize);
headerSize = osmpbf::host2NetLong(headerSize);
osmpbf::lseek(m_FileDescriptor, headerSizePosition, IO_SEEK_SET);
osmpbf::write(m_FileDescriptor, &headerSize, sizeof(uint32_t));
osmpbf::lseek(m_FileDescriptor, blobPosition, IO_SEEK_SET);
Expand Down
5 changes: 3 additions & 2 deletions osmpbf/include/osmpbf/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

namespace osmpbf {

uint32_t ntohl(uint32_t v);
uint32_t htonl(uint32_t v);
uint32_t net2hostLong(uint32_t v);

uint32_t host2NetLong(uint32_t v);

}//end namespace osmpbf

Expand Down
4 changes: 2 additions & 2 deletions osmpbf/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

namespace osmpbf {

uint32_t ntohl(uint32_t v) {
uint32_t net2hostLong(uint32_t v) {
return ::ntohl(v);
}

uint32_t htonl(uint32_t v) {
uint32_t host2NetLong(uint32_t v) {
return ::htonl(v);
}

Expand Down

0 comments on commit 85718e1

Please sign in to comment.