GithubHelp home page GithubHelp logo

twc's People

Contributors

baines avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

twc's Issues

off-by-one tests with ArgCount

char* DeclName = ArgCount >= 3 ? ArgValues[3] : "code/twitter_api.h";
char* ImplName = ArgCount >= 4 ? ArgValues[4] : "code/twitter_api.c";

in codegen.c should be >= 4, >= 5

C89 Compatibility

There are three things using C99 features:

  • twc_option and twc_buffer construction macros
  • exactly one other macro construction somewhere in twitter.c
  • declare-anywhere used here and there

None of these are critical, and use of the former needs to be scoped down a lot anyway for ease of language binding. C89 compat is a reasonable target and likely opens up path for compiling on less recent compilers (e.g. older versions of MSVC)

Should #include <alloca.h> in addition to #include <malloc.h>

In twitter.c, you should #include <alloca.h> for alloca. I get undefined references to alloca without this when trying to build my program with your library.

└──> dmd -debug -Jres/ blog.d libtwc.a -L-lcurl
libtwc.a(twitter.o): In function 'twc_GenerateOAuthSignature':
/home/mio/scripts/blog/bin/twc/code/twitter.c:700: undefined reference to `alloca'

ketmar tells me this is because of a gcc specific hack that transforms alloca into __builtin_alloca which gets inlined.

Here is a quote from man 3 alloca

Notes on the GNU version
Normally, gcc(1) translates calls to alloca() with inlined code. This is not done when either the -ansi,
-std=c89, -std=c99, or the -std=c11 option is given and the header <alloca.h> is not included. Otherwise,
(without an -ansi or -std=c* option) the glibc version of <stdlib.h> includes <alloca.h> and that contains the
lines:
#ifdef GNUC
#define alloca(size) __builtin_alloca (size)
#endif
with messy consequences if one has a private version of this function.
The fact that the code is inlined means that it is impossible to take the address of this function, or to
change its behavior by linking with a different library.

twc_Statuses_Update fails with error code 44

Can you confirm this issue on your end?
My test code is as follows:

        auto tweet = "looks like @chronaldragon's twc is working :) (this tweet sent from a #dlang script)";
        enforce(twc_statuses_updatee_params.init.MediaIds == null);
        twc_call_result x = twc_Statuses_Update(&twitter, twc_ToString(tweet.toStringz),
                twc_statuses_updatee_params.init);
        writefln("%s", x.ErrorStr.Ptr[0..x.ErrorStr.Size]);

The response:

{"errors":[{"code":44,"message":"media_ids parameter is invalid."}]}

alloca.h is not standard

../code/twitter.c(5): fatal error C1083: Cannot open include file: 'alloca.h': No such file or directory

cp is not part of windows in build.bat

'cp' is not recognized as an internal or external command, operable program or batch file.

you might have some linux tools in your path. you can use copy instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.