Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify public struct typedefs to enable fwd declaration in C++ #6

Open
tomasandrle opened this issue Aug 9, 2019 · 0 comments
Open

Comments

@tomasandrle
Copy link

It would be helpful to change

typedef struct {
...
} plm_frame_t;

into

typedef struct plm_frame_t {
...
} plm_frame_t;

This would make it easier to forward-declare the structs in a C++ header without including pl_mpeg.h from there, exposing it to the rest of the program.

Example my.hpp:

struct plm_frame_t; // trying to not include pl_mpeg.h here

class MyClass {
public:
    void render( plm_frame_t *frame );
};

Example my.cpp:

#include "my.hpp"
#define PL_MPEG_IMPLEMENTATION
#include "pl_mpeg.h"

MyClass::render( plm_frame_t *frame ) {
...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant