Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
widlarizer committed Dec 19, 2024
1 parent 2857264 commit b2ba4a1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ YOSYS_SRC := $(dir $(firstword $(MAKEFILE_LIST)))
VPATH := $(YOSYS_SRC)

CXXSTD ?= c++17
CXXFLAGS := $(CXXFLAGS) -Wall -Wextra -Werror=implicit-function-declaration -ggdb -I. -I"$(YOSYS_SRC)" -MD -MP -D_YOSYS_ -fPIC -I$(PREFIX)/include
CXXFLAGS := $(CXXFLAGS) -Wall -Wextra -ggdb -I. -I"$(YOSYS_SRC)" -MD -MP -D_YOSYS_ -fPIC -I$(PREFIX)/include
LIBS := $(LIBS) -lstdc++ -lm
PLUGIN_LINKFLAGS :=
PLUGIN_LIBS :=
Expand Down
Empty file added kernel/gzip.h
Empty file.
2 changes: 2 additions & 0 deletions kernel/io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ std::string escape_filename_spaces(const std::string& filename)

PRIVATE_NAMESPACE_BEGIN

using namespace Zlib;

static const size_t GZ_BUFFER_SIZE = 8192;
static void decompress_gzip(const std::string &filename, std::stringstream &out)
{
Expand Down
5 changes: 4 additions & 1 deletion kernel/io.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#include "kernel/yosys_common.h"
#include <string>
#include <unistd.h>

#ifndef YOSYS_IO_H
#define YOSYS_IO_H

#ifdef YOSYS_ENABLE_ZLIB
namespace Zlib {
#include <zlib.h>
} // namespace
#endif

YOSYS_NAMESPACE_BEGIN
Expand Down Expand Up @@ -86,7 +89,7 @@ class gzip_ostream : public std::ostream {
private:
static const int buffer_size = 4096; // Size of the internal buffer
char buffer[buffer_size]; // Internal buffer for compressed data
gzFile gzf = nullptr; // Handle to the gzip file
Zlib::gzFile gzf = nullptr; // Handle to the gzip file
};

gzip_streambuf outbuf; // The stream buffer instance
Expand Down

0 comments on commit b2ba4a1

Please sign in to comment.