tporadowski / redis

Native port of Redis for Windows. Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs. This repository contains unofficial port of Redis to Windows.
http://redis.io
Other
8.9k stars 1.09k forks source link

Template project for redis module #103

Closed AachoLoya closed 1 year ago

AachoLoya commented 3 years ago

Can you create a template Visual studio project for this module? https://redislabs.com/blog/writing-redis-modules/

I've been trying to create one but got exception while loading the module. Also, was looking at ReJSON example, and it appears that you have your own version of redismodule.h and also a win32_port.h file. Would be nice if there was a project explaining differences from linux version, so we can easily port or create new modules for windows-redis.

technomagos commented 3 years ago

Sample online module helloworld.rand works ok for me, if you compile in vs after changing this line using "long long" in redismodule.h (the shipped redismodule.h in SDK should be amended to take care of this; redis developers seem to clearly ignore the existence of windows OS) RedisModule_GetApi = (int ()(const char , void )) (unsigned long long*)getapifuncptr;

and in the module you do this __declspec(dllexport) int RedisModule_OnLoad(